Disc upgrade - how to reread partition table?
Peter Kjellstrom
cap at nsc.liu.se
Wed Nov 14 13:54:29 CST 2007
On Wednesday 14 November 2007, Todd Lyons wrote:
> On Wed, Nov 14, 2007 at 05:10:23PM +0100, Peter Kjellstrom wrote:
> >This thread is getting real thick with incorrect guesses and assumptions.
> >ext3 is just as able to online (while mounted) resize as xfs (man
> > resize2fs).
>
> Didn't know it could be done while mounted. Thanks for that.
>
> >Regarding the partition table updating. partprobe can be used and works
> > even with a mounted root filesystem on the drive as: "partprobe
> > /dev/sda".
>
> In general, if you have primary partitions on the drive and you modify
> those primary partitions, the kernel can reload the new partition table
> without a reboot (that's the ioctl call as fdisk exits). If you have
> any logical partitions on the drive, the kernel will not see those and
> you'll need a reboot.
You've got it a bit messed up. What fdisk tries at exit (ioctl wise) is not
the same as what partprobe does. If you modify your partition table with
fdisk (assuming / mounted from an fs on that drive) a subsequent "fdisk -l"
will indeed show the change but, as fdisk says, the kernel still has the old
version.
This means (among other things) that you can't mkfs it (since, assuming udev,
there isn't even a device file yet). Running partprobe updates all this.
Very simple example (done on centos-5) with / mounted from sda1:
1) fdisk create sda2
2) fdisk -l, yup it's there
3) mkfs /dev/sda2, nope, no device
4) partprobe /dev/sda
5) mkfs /dev/sda2, yup now works.
On the same centos-5 system I double-checked and no, there is no difference
made between primary and extended partitions.
/Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.us.dell.com/pipermail/linux-poweredge/attachments/20071114/1c6ab9ef/attachment.sig
More information about the Linux-PowerEdge
mailing list