Gelen James
2013-May-24 17:56 UTC
[CentOS] Failed to create /dev/loop0p* entries for partitions inside loopback devices
centos 6 failed to create entries under /dev for newly created loopback devices. Any one know why? and how to fix/workaround it? The steps to duplicate is pretty simple dd if=/dev/zero of=/tmp/deleteme bs=1M count=100 losetup /dev/loop0 /tmp/deleteme fdisk /dev/loop0?? ## created partitions 1, 2, etc. fdisk -l /dev/loop0? ## confirmed that the partitions do exist mkfs.ext3 /dev/loop0p1 ## failed here, the error prompt says that the /dev/loop0p1 doesn't exist! ls /dev/loop0p*? ## no entries Please shed a light here, I'm running centos 6.4 Thanks. Robert
Paul Heinlein
2013-May-24 18:05 UTC
[CentOS] Failed to create /dev/loop0p* entries for partitions inside loopback devices
On Fri, 24 May 2013, Gelen James wrote:> centos 6 failed to create entries under /dev for newly created loopback devices. Any one know why? and how to fix/workaround it? > > The steps to duplicate is pretty simple > > dd if=/dev/zero of=/tmp/deleteme bs=1M count=100 > losetup /dev/loop0 /tmp/deleteme > fdisk /dev/loop0?? ## created partitions 1, 2, etc. > fdisk -l /dev/loop0? ## confirmed that the partitions do existAt this point, you need to run "kpartx -a /dev/loop0" (fdisk should have told you so).> mkfs.ext3 /dev/loop0p1 ## failed here [...]kpartx drops partitions into /dev/mapper, so the actual invocation would be mkfs.ext3 /dev/mapper/loop0p1 You can also use partprobe instead of kpartx, but I'm not as familiar with its operation. -- Paul Heinlein heinlein at madboa.com 45?38' N, 122?6' W