PDA

View Full Version : udev does not create /dev/xvf2 after creating new partition



Flako000
12-Oct-2012, 15:51
Hello
I'm using SLES 11 SP2 to Dom0, and SLED 11SP1 in DomU.
In domU, I have disk "/dev/xvdf: 96.6 GB" in dom0 is a pv02 PV-LVM.
After pv02 enlarge and see it reflected in domU:/dev/xvdf created a new partition with the free space of the form:


# fdisk -l /dev/xvdf
Disk /dev/xvdf: 98.8 GB, 98784247808 bytes
255 heads, 63 sectors/track, 12009 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/xvdf1 * 1 11748 94365778+ 8e Linux LVM
/dev/xvdf2 11749 12009 2096482+ 8e Linux LVM




After creating the partition, I see that udev does not create /dev/xvdf2, I try to create with "mknod /dev/xvdf2 b 202 82", but this does not work properly (I can not format the partition)



# mkfs.ext3 /dev/xvdf2
mke2fs 1.41.9 (22-Aug-2009)
mkfs.ext3: No such device or address while trying to determine filesystem size


in /proc/ partitions does not appear xvdf2.
udev restart (/ etc / init.d / boot.udev force-reload) but fails to do walk /dev/xvdf2.
Need to shut down the domU to work, configure udev:



# ls-lh / dev / xvdf *
brw-rw ---- 1 root disk 202, 80 October 10 19:29 /dev/ xvdf
brw-rw ---- 1 root disk 202, 81 October 10 18:26 /dev/xvdf1
brw-rw ---- 1 root disk 202, 82 October 10 20:28 /dev/xvdf2



I feel abnormal having to power down the domU to take the device .. (linux reboots ignorantly)
The strangest thing is that try to do the same (after restart) and I generates udev /dev/ correctly.
I missed doing the first time?



Thanks for getting this far (sorry for using translate)

jmozdzen
15-Oct-2012, 15:04
Hi Flako000,

I'm not sure I fully understood the situation, please correct me if I did:

After extending DomU's boot disk, you create a new partition for the (now available) free disk space from within the DomU.

I would not expect to see a device for the new partition - a partition table rescan would be required for this, which AFAIK is only possible for disk devices that are currently unused. As this is you boot disk, there are open mounts/partitions/LVs on that disk, so it takes a reboot to recognize the new partition and to create the device file.

> The strangest thing is that try to do the same (after restart) and I generates udev /dev/ correctly.

Do you mean to create another partition after restart (DomU reboot)? Shouldn't work. Or have you, after the reboot, deleted the partition, then recreated the partition, and then checked for /dev/xvdf2? That'd be the device for partition 2 right after the reboot, not for the new one. I.e. if you create 2 new partitions, you'd still see "p2" with it's previous full extend and no p3 device until reboot.

Regards,
Jens