From: lsorense@csclub.uwaterloo.ca (Lennart Sorensen)
To: Gene Heskett <gene.heskett@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Possibly silly Q?
Date: Tue, 15 Jan 2008 12:01:17 -0500 [thread overview]
Message-ID: <20080115170117.GP2310@csclub.uwaterloo.ca> (raw)
In-Reply-To: <200801141434.00934.gene.heskett@gmail.com>
On Mon, Jan 14, 2008 at 02:34:00PM -0500, Gene Heskett wrote:
> Do we have a utility that can force the kernel to re-read, and re-initialize
> itself to a given drives partition tables without having to reboot if one is
> working with a drive that is not part of the required kernel directory tree?
>
> The reason I ask, is that I've just spent about 20 hours fighting with amanda
> after repartitioning a drive for use by amanda as virtual tapes,
> making /dev/sdc1 into a primary partition of nearly 400GB. /dev/sdc1 started
> out as a /boot2 labeled partition of 200mb, and because the kernels data was
> stale, amanda upchucked all over itself when the kernel thought the original
> 200Mb had been filled when it had been umounted from /mnt/bootf8
> repartitioned, mke2fs'd, a journal added and a new label written and then
> mounted to /amandatapes.
>
> Something it seems to me, should have forced the re-init, but didn't. So is
> there a tool that can force that?
In my experience fdisk (whichever one you use) will ask the kernel to
reread the partition table on write.
The kernel refuses to reread the partition table on any disk where it
has anything mounted. So if any part of the disk is in use then it
refuses to change anything about it's view of that disk.
So if you only have partitions mounted from sda and sdb then you can
repartition sdc and it will reload the partition table just fine. If
any part of sdc is mounted or otherwise in use then you can't.
I have often wondered how hard it would be to change the kernel
behaviour so that it only refuses to reload the partition table if the
partitions that are in use on the disk are being changed, but let it
reload the partition table if only unused partitions are being changed.
For example:
sdc1 200MB mounted
sdc2 500MB not mounted
sdc3 300MB not mounted
Delete sdc2 and sdc3 and create a new sdc2 that is 800MB
Since sdc1 is not changed (no change in size or start and end locations
in partition table), then the kernel should let the partition table be
reloaded since there is no affect on the in use partition.
After all it seems the disk manager in windows is capable of this, so
perhaps linux ought to be as well. It may not be relevant very often,
but it sure is annoying having to go through multiple reboots when doing
certain disk layout changes just because you are using and not changing
one partition on a disk.
--
Len Sorensen
prev parent reply other threads:[~2008-01-15 17:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-14 19:34 Gene Heskett
2008-01-14 19:37 ` Robert P. J. Day
2008-01-14 19:50 ` Sven-Haegar Koch
2008-01-14 19:43 ` Jan Engelhardt
2008-01-14 19:53 ` Dagfinn Ilmari Mannsåker
2008-01-14 20:53 ` Robert P. J. Day
2008-01-15 16:43 ` Jan Engelhardt
2008-01-14 19:55 ` Anton Altaparmakov
2008-01-14 21:29 ` Olaf Titz
2008-01-14 22:17 ` Jan Engelhardt
2008-01-15 17:01 ` Lennart Sorensen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080115170117.GP2310@csclub.uwaterloo.ca \
--to=lsorense@csclub.uwaterloo.ca \
--cc=gene.heskett@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®