 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

15th March 2009, 11:11 PM
|
|
Registered User
|
|
Join Date: Mar 2009
Posts: 3

|
|
|
how to e2fsck an encrypted filesystem?
First off, let me say that I'm a recent linux convert (4 months), and have used Ubuntu up until this past week... I just felt like trying something new. Fedora rocks my world! I had a few hiccups at first, but I've got everything squared away now, except...
I don't know how the heck to e2fsck an encryped filesystem. In my unencrypted ubuntu, I would boot into the live cd and run the command on my root filesystem here... but since my root partition is encrypted, how can I run the check without first mounting the volume. (I'm under the assumption that the warning in the terminal is correct about running it on a mounted filesystem -- that it can cause severe damage)
Thanks for your help guy!
(P.S. I did a search and came up with nothing... not even the almighty google helped)
|

17th March 2009, 06:12 PM
|
 |
Registered User
|
|
Join Date: Jan 2008
Location: New Delhi, India
Posts: 2,068

|
|
Hi,
I don't suppose there is a separate way to fsck an encrypted partition, although I could be wrong on this. The next thing to keep in mind is to never run e2fsck directly (so its man page says) always run fsck, and the last point never run fsck on a mounted partition.
Try this (maybe this'll work)
Code:
|# fsck -C /dev/sdb1
Report back if there's any trouble.
|

17th March 2009, 06:31 PM
|
|
Registered User
|
|
Join Date: Jul 2005
Location: Kentucky, U.S.A.
Posts: 349

|
|
Assuming that you have a standard luks setup, you should be able to do this via the live cd or using rescue mode.
Boot up with the cd; Open a terminal and su to root, then something like:
Code:
cryptsetup luksOpen /dev/sda[n] cryptroot {enter password when prompted}
fsck.ext3 -y -f /dev/mapper/cryptroot
cryptsetup luksClose cryptroot
If you are using an encrypted LVM volume, you will need to alter the fsck.ext3 command to reflect the correct logical volume.
|

17th March 2009, 06:39 PM
|
|
Registered User
|
|
Join Date: Jul 2005
Location: Kentucky, U.S.A.
Posts: 349

|
|
I just reread your post and realized... You should be able to just do the following from a terminal as root then reboot the system.
nash will run the file check when you reboot, saves a lot of headache.
|

17th March 2009, 07:15 PM
|
|
Registered User
|
|
Join Date: Mar 2009
Posts: 3

|
|
Thanks guys for your replies.
LinuxTom, When I tried your first set of commands, all went well up until the second one. (fsck.ext3 -y -f /dev/mapper/cryptroot)
I named my encrypted partition Encrypted Data, so I changed the 'cryptroot' to 'Encrypted Data' in both commands to reflect my setup, the problem was, when I executed the second command, it just gave me the page that would have come up if I typed --help (below)
Code:
Usage: fsck.ext3 [-panyrcdfvtDFV] [-b superblock] [-B blocksize]
[-I inode_buffer_blocks] [-P process_inode_size]
[-l|-L bad_blocks_file] [-C fd] [-j external_journal]
[-E extended-options] device
Emergency help:
-p Automatic repair (no questions)
-n Make no changes to the filesystem
-y Assume "yes" to all questions
-c Check for bad blocks and add them to the badblock list
-f Force checking even if filesystem is marked clean
-v Be verbose
-b superblock Use alternative superblock
-B blocksize Force blocksize when looking for superblock
-j external_journal Set location of the external journal
-l bad_blocks_file Add to badblocks list
-L bad_blocks_file Set badblocks list
So then I got back online and read your second post, and ran the command 'touch /.autofsck' as root... then rebooted... problem was, nothing out of the ordinary happened, it asked for my passphrase, when through a normal boot sequence (so it looked...) then came to the login screen.
This brings me to my next question, being a recent convert from widows, old habits seem to be dying hard. Do I actually need to run this command to maintain a healthy filesystem, or should it only be run if something is wrong?
|

17th March 2009, 08:13 PM
|
 |
Retired User
|
|
Join Date: Oct 2004
Location: London, UK
Posts: 4,999

|
|
|
|

18th March 2009, 01:07 AM
|
|
Registered User
|
|
Join Date: Mar 2009
Posts: 3

|
|
|
Sideways -
I ran your command, and I'm assuming that it worked, since the boot process took much longer than it normally does.
Thanks a bunch!
I didn't see any results or anything similar, is that normal?
|

18th March 2009, 01:33 AM
|
 |
Retired User
|
|
Join Date: Oct 2004
Location: London, UK
Posts: 4,999

|
|
|
If it took ages then an fsck was definitely run, I recall seeing the same blank screen in F10, perhaps the messages are directed to another console (there are 6) but there should be messages in /var/log/messages, scroll up to the timestamp beginning at boot. and check from there. Also check 'cat /var/log/boot.log'
Last edited by sideways; 18th March 2009 at 01:36 AM.
|

18th March 2009, 01:42 AM
|
 |
Registered User
|
|
Join Date: Jun 2004
Location: Laurel, MD USA
Posts: 5,449

|
|
|
I think you can use tune2fs -l <device name>
in case you want to confirm for yourself that a check was done, look at the Last checked: value. I'm not up on encrypted filesystems so that's assuming one of those will work with tune2fs. The "-l" option is a non-dangerous, query only command anyway so it can't hurt.
Last edited by marko; 18th March 2009 at 01:44 AM.
|

18th March 2009, 05:43 PM
|
|
Registered User
|
|
Join Date: Jul 2005
Location: Kentucky, U.S.A.
Posts: 349

|
|
|
Sideways caught my flub, I was thinking of /.autorelabel forgot it was /{force}fsck
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 18:13 (Tuesday, 21-05-2013)
|
|
 |
 |
 |
 |
|
|