grml / grml2usb

install Grml ISOs to USB keys
https://grml.org/grml2usb/
18 stars 15 forks source link

Improve documentation for usage with loop back devices (disk images) #45

Open ventosus opened 3 years ago

ventosus commented 3 years ago

Would be nice if this would work on loopback devices

fallocate -l 950M /tmp/image.dd
sfdisk ...
losetup -o $(( 2048*512 )) /dev/loop0 /tmp/image.dd
losetup -o $(( 1003520*512 )) /dev/loop1 /tmp/image.dd

mkfs.vfat /dev/loop0
mkfs.ext4 -L persistence /dev/loop1

grml2usb ... /dev/loop0

I don't see why is couldn't, but currently it fails upon installing the MBR, because it cannot find de device of /dev/loop0, which is the disk image /tmp/image.dd

mika commented 3 years ago

Hm, what's your use case to use it on a loopback device?

ventosus commented 3 years ago

Hm, what's your use case to use it on a loopback device?

Automated building on a machine I have no physical access to.

schoelpi commented 3 years ago

Hm, what's your use case to use it on a loopback device?

Unfortunately I also have trouble with this feature. Since usage of loopback devices is explicitly mentioned in the manpage, I think this should be considered to be fixed.

ventosus commented 3 years ago

@schoelpi this works with the git version, forgot to close the issue.

Make sure to load your loopback module with support for loopback partitions (default off).

modprobe loop max_loop=8 max_part=8
schoelpi commented 3 years ago

modprobe loop max_loop=8 max_part=8

Ah great, thank you for your quick response. It works, although I had to figure out, that I had to use -P option for losetup and kick out kpartx instead ;-)

mika commented 3 years ago

I'm reopening this, as our docs should be properly clarify its usage, thanks everyone :)