Re: losetup -a only reporting a maximum of 256 loop devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 30, 2007 at 04:53:17PM +0100, Karel Zak wrote:
> On Sat, Oct 27, 2007 at 12:44:51PM +0200, devzero@xxxxxx wrote:
> > it seems that losetup doesn`t yet honour recent kernel change (see
> > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=73285082745045bcd64333c1fbaa88f8490f2626
> > ) to allow more than 256 loop-devices.
> 
>  Ah, I remember this thing from lkml.
> 
> > loop-device creation is dynamically now, is there already work in
> > progress for support in losetup  ?
> 
>  If I good remember there is not any other who how create a loop device
>  than by "max_loop" or "mknod /dev/loopN". It means we needn't to add
>  to losetup(8) any extra support for dynamically allocated loop devices.
> 
>  So, we need increment hardcoded limit of loop devices only. Right?

 Note, there is also list of loop devices in /sys/block, but it's
 useless for never used loop devices. See:

 # mknod /dev/loop100 b 7 100
 # ls -la /dev/loop100
 brw-r--r-- 1 root root 7, 100 2007-10-30 17:14 /dev/loop100

 # stat /sys/block/loop100
 stat: cannot stat `/sys/block/loop100': No such file or directory
                                         ^^^^^^^^^^^^^^^^^^^

  Why? It doesn't make sense. Ken, cannot we create /sys/block/loopN
  when the device is allocated in kernel? It seems kernel creates
  these /sys files when the device is used first time.


 # losetup /dev/loop100 /mnt/store/images/fs/ext3.img

 # stat -t /sys/block/loop100
 /sys/block/loop100 0 0 41ed 0 0 0 13994 4 0 0 1193761350 1193760920
 1193760920 4096

 # losetup -d /dev/loop100

 # stat -t /sys/block/loop100
  /sys/block/loop100 0 0 41ed 0 0 0 13994 4 0 0 1193761350 1193760920
  1193760920 4096

 Wow, the directory /sys/block/loop100 is persistent now.


 BTW, losetup -a (and -f) is useless when you have holes in list of
 devices, for example I have:

         /dev/loop0
         /dev/loop1
         /dev/loop2
         /dev/loop3
         /dev/loop4
         /dev/loop5
         /dev/loop6
         /dev/loop7
         /dev/loop100

 # losetup /dev/loop100 /mnt/store/images/fs/ext3.img

 # losetup /dev/loop100
 /dev/loop100: [0807]:21921802 (/mnt/store/images/fs/ext3.img)

 # losetup -a   <--- nothing... loop100 is invisible. Bug :-(

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux