Public bug reported:

Binary package hint: util-linux

i made a dd image of my laptop drive and try to work with it (mount,
resizing etc).

# losetup -a
/dev/loop0: [fe01]:29253634 (/image.dd)

# fdisk -lu /dev/loop0

Disk /dev/loop0: 60.0 GB, 60011642880 bytes
240 heads, 63 sectors/track, 7752 cylinders, total 117210240 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x46514650

      Device Boot      Start         End      Blocks   Id  System
/dev/loop0p1   *          63     8814959     4407448+   b  W95 FAT32
/dev/loop0p2         8814960   117210239    54197640    f  W95 Ext'd (LBA)
/dev/loop0p5         8815023   117210239    54197608+   7  HPFS/NTFS

the first partition is about 4,5GB, the rest is a logical partition.
i first tried to use http://vytautas.jakutis.lt/node/26 but that did not work 
and i did not look into it, because i knew of the offset method as described 
here http://www.fluidsignal.com/en/publications/knowledge/20080923090245 .
so... i tried to use the losetup -o option to create loop devices for the 
partitions.
offset = start block * 512
offset p1 = 63 * 512 = 32256
=> losetup -fo 32256 /dev/loop0
this worked ok (can't redo atm, see below)

offset p5 = 4513291776
this is > 2^32.
if i try to use that offset, it seems to work ok the first time (it returns 
instantly), but does not create a new loop device.
if you try it again, it hangs with consuming 100% cpu time of one core.
i straced it afterwards:
<libc stuff, locale stuff>
stat("/dev", {st_mode=S_IFDIR|0755, st_size=14560, ...}) = 0
stat("/dev/loop", 0x7fff3d71f7e0)       = -1 ENOENT (No such file or directory)
stat("/dev/loop0", {st_mode=S_IFBLK|0660, st_rdev=makedev(7, 0), ...}) = 0
open("/dev/loop0", O_RDONLY)            = 3
ioctl(3, 0x4c03, 0x7fff3d71f6f0)        = 0
close(3)                                = 0
stat("/dev/loop1", {st_mode=S_IFBLK|0660, st_rdev=makedev(7, 1), ...}) = 0
open("/dev/loop1", O_RDONLY)            = 3
ioctl(3, 0x4c03, 0x7fff3d71f6f0)        = -1 EOVERFLOW (Value too large for 
defined data type)
close(3)                                = 0
open("/dev/loop0", O_RDWR)              = 3
open("/dev/loop1", O_RDWR)              = 4
readlink("/dev", 0x7fff3d71d620, 4096)  = -1 EINVAL (Invalid argument)
readlink("/dev/loop0", 0x7fff3d71d620, 4096) = -1 EINVAL (Invalid argument)
ioctl(4, 0x4c00, 0x3)                   = -1 EBUSY (Device or resource busy)
close(4)                                = 0
close(3)                                = 0
here it loops:
stat("/dev", {st_mode=S_IFDIR|0755, st_size=14560, ...}) = 0
stat("/dev/loop", 0x7fff3d71f7e0)       = -1 ENOENT (No such file or directory)
stat("/dev/loop0", {st_mode=S_IFBLK|0660, st_rdev=makedev(7, 0), ...}) = 0
open("/dev/loop0", O_RDONLY)            = 3
ioctl(3, 0x4c03, 0x7fff3d71f6f0)        = 0
close(3)                                = 0
stat("/dev/loop1", {st_mode=S_IFBLK|0660, st_rdev=makedev(7, 1), ...}) = 0
open("/dev/loop1", O_RDONLY)            = 3
ioctl(3, 0x4c03, 0x7fff3d71f6f0)        = -1 EOVERFLOW (Value too large for 
defined data type)
close(3)                                = 0
open("/dev/loop0", O_RDWR)              = 3
open("/dev/loop1", O_RDWR)              = 4
readlink("/dev", 0x7fff3d71d620, 4096)  = -1 EINVAL (Invalid argument)
readlink("/dev/loop0", 0x7fff3d71d620, 4096) = -1 EINVAL (Invalid argument)
ioctl(4, 0x4c00, 0x3)                   = -1 EBUSY (Device or resource busy)
close(4)                                = 0
close(3)                                = 0
rinse repeat

i searched for help and found 
http://www.linuxforums.org/forum/redhat-fedora-linux-help/111777-losetup-offset-there-limit-overflow.html
that indicates, that there was a bug and it was fixed before 2.13-pre7.
i use util-linux     2.14-1ubuntu2
but maybe its an amd64 bug, since im running 64bit ubuntu 8.10.

after trying a too big offset, it is broken until reboot:
i cant use a small offset.
i cant detach the whole disk image.
i cant rmmod loop.

ill reboot now and strace the first run with a too big offset.

** Affects: util-linux (Ubuntu)
     Importance: Undecided
         Status: New

-- 
losetup 32bit offset limit, hang, remaining defunct
https://bugs.launchpad.net/bugs/313385
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to