[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [**solved by a reboot**] moving (and losing?) partitions with cfdisk



Daniel B. wrote:
Levi Waldron wrote:

3.  after changing your partition table, you really do have to reboot
- at least this is my best guess as to what the problem was.


Sometimes you can avoid the need to reboot:

If you can unmount every other partition that is on the disk whose
partition table you are modifying, then when you write the partition
table with fdisk or whatever, the kernel can re-load the partition
table and you won't get the message about needing to reboot for the
changed partitioning to take effect.

I wondered if something like that were the case.

Of course, that doesn't work for the disk containing your root
filesystem partition (because you won't be able to unmount that
partition because it's in use), but it can save rebooting if you're
repartitioning a different disk.


How about doing a mount -o remount?
There might be some work-around.

But here's a question:  Why can't the kernel handle some types of
changes to a partition table (e.g., a new partition) while some
partitions are mounted?

I can think of two reasons: swap and cache.

It seems that the kernel could compare the current partition table
with the previous state of the partition table (using its in-memory
data structues derived from the partition table) and determine
whether any in-use partitions have changed.  If there have only been
deletions of partitions that are not mounted and/or additions of
partitions, then couldn't the kernel assimilate the changes (deleting
data structures for deleted partitions and creating data structures
for new partitions)?

You're asking for a fairly substantial change which would, IMO,
introduce (a) risk of not being "quite" right, and (b) would
only fix a rarely occurring situation (c) which only takes a
minute or two to do an extra reboot.


So why doesn't the kernel do that?  Is it just that no one felt it
was a useful enough feature to implement?  Is it that the kernel's
data structures (or code using them) aren't set up for deleting and
adding partitions incrementally?  Or is there some bigger limitation?

I'd guess that the usefulness is outweighed by the complexity/likelihood
of getting it wrong and the little cost (except possibly to servers)
in time to reboot.

Mike
--
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!



Reply to: