I have Oracle Linux on a VM and I'm trying to create partitions on /dev/sda2 of size 30 gigs using fdisk utility. I made four partitions each of size 512M and they appear in the partition table. However, when i try to write (w) table to disk, i get the error as above.
Here's what i've tried so far
- Reboot does not change anything.
fdisk -u -l /dev/sda2shows the 4 created partitions (p1,p2,p3,p4), butfdisk -ldoesn't.kpartx -a /dev/sda2pxshowsfailed to stat() /dev/sda2pxpartprobe /dev/sda2shows:
Error: Error informing the kernel about modifications to partition /dev/sda2px - invalid argument. This means Linux won't know about any changes you made to /dev/sda2p1 until you reboot -- so you shouldn't mount it or use it in any way before rebooting
Any ideas will be much appreciated. Thanks in advance.
22 Answers
Setting up partitions on other partitions isn't a supported operation. If you want to subdivide your /dev/sda2 then one option is to use LVM2 (that's Arch Linux documentation but applies everywhere).
For your example of three 512Mb:
pvcreate /dev/sda2
vgcreate TEST /dev/sda2
lvcreate -L 512M -n one TEST
lvcreate -L 512M -n two TEST
lvcreate -L 512M -n three TESTThis will give you /dev/TEST/one /dev/TEST/two and /dev/TEST/three as separate 512Mb slices, without having a partition within a partition.
1You should boot the system from the gparted live cd and use it to make the changes. That would tell you if it is your OS or hardware.
2