From: Theodore Tso <tytso@mit.edu>
To: Matthias Koenig <mkoenig@suse.de>
Cc: Dave Kleikamp <shaggy@linux.vnet.ibm.com>,
ludwig.nussel@suse.de, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] [RFC] New fsck option to ignore device-mapper crypto devices
Date: Wed, 12 Mar 2008 16:02:36 -0400 [thread overview]
Message-ID: <20080312200236.GE15804@mit.edu> (raw)
In-Reply-To: <n7xr6egkk6w.fsf@sor.suse.de>
On Wed, Mar 12, 2008 at 04:59:03PM +0100, Matthias Koenig wrote:
> 1. Do we agree that fstab fs_passno could be used besides fsck -A by a
> separate script to decide if a filesystem (that could not be checked
> in the fsck -A phase) should be checked?
Well, historically there have been /etc/fstab entries which look like
this:
/dev/zipdrive /media/zipdisk ext3 default,noauto 0 0
This is because there might not be a zip disk in the drive at the time
of the boot. However, a root user could insert a zip disk, and then
run the command "fsck /dev/zipdrive" and expect it to work, and the
follow that up with "mount /dev/zipdrive".
So passno == 0 can't mean "don't mount the filesystem, ever". All it
means is "don't mount it at boot". So I don't think trying to kludge
new fields into fs_passno is the way to go.
------------
So here's another way you could do things that doesn't require any
patches to fsck at all. Just add "comment=crypto" into the option
field of /etc/fstab, like this.
/dev/mapper/crypto-frobnitz /crypto1 ext3 comment=crypto 1 1
Then you can skip filesystems that have the comment=crypto in the
options field via:
fsck -AR -t opts=!comment=crypto
To check all of the filesystems that have the comment=crypto field
via:
fsck -AR -t opts=comment=crypto
Why did I use "comment=crypto"? Because if you use "crypto", then
mount will try to pass crypto to the kernel, and if the kernel doesn't
understand an option, it will reject the mount. Mount doesn't send
"comment" mount options to the kernel, so this works.
Of course, you'll need to modify mount to be able to only mount all
crypto filesystems, or not to mount any crypto filesystems, so you
could change it to understand that "crypto" is not to be passed down
to the kernel, at which point you could just have this in /etc/fstab:
/dev/mapper/crypto-frobnitz /crypto1 ext3 crypto 1 1
And then the fsck invocations would become:
fsck -AR -t opts=!crypto
and
fsck -AR -t opts=crypto
Which of course looks much nicer.
I put in the "-t opts=" matching a long time ago (as in 10+ years
ago), because someone had wanted to do something strange like this. I
had completely forgotten about it until now....
- Ted
next prev parent reply other threads:[~2008-03-12 20:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-06 13:41 [PATCH] [RFC] New fsck option to ignore device-mapper crypto devices Matthias Koenig
2008-03-06 14:32 ` Dave Kleikamp
2008-03-06 17:04 ` Matthias Koenig
2008-03-06 17:23 ` Dave Kleikamp
2008-03-06 17:42 ` Theodore Tso
2008-03-07 14:20 ` Matthias Koenig
2008-03-07 15:19 ` Dave Kleikamp
2008-03-12 15:59 ` Matthias Koenig
2008-03-12 20:02 ` Theodore Tso [this message]
2008-03-12 20:14 ` Theodore Tso
2008-03-13 5:37 ` Dave Kleikamp
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=20080312200236.GE15804@mit.edu \
--to=tytso@mit.edu \
--cc=linux-ext4@vger.kernel.org \
--cc=ludwig.nussel@suse.de \
--cc=mkoenig@suse.de \
--cc=shaggy@linux.vnet.ibm.com \
/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