Linux Loop Device

losetup 으로 루프디바이스를 설정하면 파티션들이 보여야되는데 보이지 않는 문제 발견

http://askubuntu.com/questions/69363/mount-single-partition-from-image-of-entire-disk-device#673257

loop module max_part config
This is a decent method before 16.04.
loop is a kernel module, built into the kernel in Ubuntu 14.04.
If you configure it right, Linux automatically splits up the devices for you.
If you configure it right, Linux automatically splits up the devices for you.

cat /sys/module/loop/parameters/max_part

says how many partitions loop devices can generate.
It is 0 by default on Ubuntu 14.04 which is why no auto-splitting happens.
To change it, we can either add:

options loop max_part=31

to a file in /etc/modprobe, or:

GRUB_CMDLINE_LINUX="loop.max_part=31"

to /etc/default/grub and then sudo update-grub.
How to set a module parameter is also covered at: How to add kernel module parameters?
After a reboot, when you do:

sudo losetup -f --show my.img

it mounts the image to a /dev/loopX device, and automatically mounts the partitions to /dev/loopXpY devices.

의 해결책은 조금 귀찮으므로
https://lwn.net/Articles/274113/
에서 제시한  “modprobe loop max_part=63” 를 사용,

root@debian:~/z# ls /dev/loop0p*
/dev/loop0p1 /dev/loop0p2 /dev/loop0p3 /dev/loop0p4 /dev/loop0p5 /dev/loop0p6 /dev/loop0p7

잘된다

Leave a Reply

Your email address will not be published. Required fields are marked *