Re: 9G disk, >4 partitions, and lose95

kwrohrer@ce.mediaone.net
Wed, 21 Oct 1998 16:09:31 -0500 (CDT)


And lo, Guest section DW saith unto me:
>
> > 2) When you fdisk the drive you've got root mounted off of (even
> > read-only), linux-2.1.125 (and possibly earlier) won't reread the partition
> > table, and with 2.1.125 it *seemed* like it wouldn't even *write* the table
> > out to disk with root mounted read-only on it.
>
> If /dev/sda has a partition /dev/sda6 that is mounted read-only on /,
> that does not mean that /dev/sda is read-only.
Agreed. It shouldn't even *seem* that way. Maybe it wasn't syncing when
the reread ioctl failed, but I repeatedly deleted partitions, told
fdisk to save the partition table, waited for the prompt, and rebooted
to find that the deletions hadn't taken effect. I was deleting /dev/sda[56],
btw, and / was on /dev/sda1.

(Un)fortunately, I'm done wrestling with my partition table now, or I'd
build a new fdisk and try again to make sure it wasn't just me forgetting
to sync and fdisk being too astonished at the ioctl failing to sync for
me...

> But the kernel does not reread a partition table of a disk
> that is busy, and having a partition mounted on root certainly
> means being busy.
>
> Of course a more fine-grained test is possible (where one
> checks that no significant things have changed, e.g., that
> /dev/sda6 is still the same partition at the same disk location),
> but it is a bit tricky to make sure nothing has been forgotten -
> and it puts a burden on future maintenance of the kernel,
> so at present it is easiest to repartition a disk with the
> root mounted elsewhere (a floppy, a ram disk, another disk),
> or to reboot after repartitioning.

I'm thinking something along the lines of rootfs (not a normally-
mounted root filesystem, mind you, but that magic thing controlled
by rdev or lilo, not fstab) not couting as usage as far as re-
reading of the partition table, but if rootfs is modified then
do an immediate sync and reboot (unless it was just a label change).
An are-you-sure prompt from fdisk is in order anyway, if somebody's
fdisking their root partition out from under themselves and fdisk can
reasonably tell that they're doing so...

Keith

-- 
"The avalanche has already started; |Linux: http://www.linuxhq.com     |"Zooty,
it is too late for the pebbles to   |KDE:   http://www.kde.org         | zoot
vote." Kosh, "Believers", Babylon 5 |Keith: kwrohrer@enteract.com      | zoot!"
 www.midwinter.com/lurk/lurker.html |http://www.enteract.com/~kwrohrer | --Rebo

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/