On Sat, May 09, 2009 at 06:22:00PM -0400, Andres Salomon wrote:
> Creating a zero-length /etc/mtab file doesn't work if, for some
> reason, /etc is mounted read-only.  Having a fully supported and
> supportable system isn't always available.  If resize2fs is going to
> stipulate that the filesystem that it's shrinking is not mounted, then
> users are going to use it in things like recovery cds and initramfs's.

You said you had an initramfs mounted, remember?   

And as I said, if /etc is mounted read-only, then it's almost certain
that / is mounted read-only, and an off-line shrink using resize2fs is
not safe to run on a mounted filesystem.  (Also, if /etc is mounted
read-only, there normally is an /etc/mtab file.)

The real problem here is that initramfs isn't including a proper
/etc/mtab file --- but it's an initramfs, which means you can fix it,
by definition.

A much simpler and safer solution, instead of trying to subvert
resize2fs safety mechanisms, is to fix the initramfs scripts to create
the /etc/mtab file in the first place.

> I like my tools to get out of the way and allow me to what I want to
> do.  That's why I use free software (transparency and hackability).
> I'm fine w/ all kinds of warnings to tell the user that they shouldn't
> continue, so long as they are also told of a way to actually continue.

Well, it's free software, so if you want to disable the safety
mechanisms, you have the freedom to do it.  Call me silly, but I'm the
sort of person that believes in showing people the right way to use a
table saw, and *not* accepting a suggestion to ship table saws with an
documented way of subverting the safety guards that (for example)
tries to prevent people from sawing their fingers off.

What's wrong with fixing the initramfs tools to create a proper
/etc/mtab file?  

> > For example, we could have a script fragment that checks for the
> > existence of a file which matches the pattern /on-initrd-*.tar.gz, and
> > if one or more such files exists, they are copied to the initrd, and
> > then the root filesystem is unmountd, and one by one, the
> > on-initrd-*.tar.gz files are unpacked and the /on-initrd script
> > contained in the tar.gz file is executed.
> > 
> > This could be used to perform an off-line shrink of the root
> > partition, by having the user request such a thing, and then
> > rebooting, and having it happen automatically.  It could also be used
> > to add or remove a journal safely, as well as repack and optimize
> > directories (e2fsck -fD).
> 
> Sounds like additional unnecessary complexity to me.

But it's easier and safer for users to use.  Teaching users that's
it's OK to use "force" options scares the hell out of me.

Trust me.  Most Linux users, from numerical standpoint, are stupid.
This isn't like it was ten years ago.  

There's a reason why lawnmowers have safety mechanisms that stop the
blade from spinning if one of the wheels is lifted off the ground.  It
turns out some number of idiots were trying to pick up a lawnwomer and
use it to trip their hedges, and then when they dropped the lawnmower
on their leg(s), they lost a foot.  Oops.  They were then able to find
a lawyer who was able to successfully sue the lawnmower manufacturer
for negligence (which is its own problem, and speaks to the US legal
system).  This just goes to prove what H. L. Mencken once stated:

    Nobody ever went broke underestimating the intelligence of the
    American people

Unfortunately, this tends to be true world-wide, not just for the
general American Public....

                                                - Ted






-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to