Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 15th March 2009, 11:11 PM
kalashinaia Offline
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)
Reply With Quote
  #2  
Old 17th March 2009, 06:12 PM
notageek's Avatar
notageek Offline
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.
Reply With Quote
  #3  
Old 17th March 2009, 06:31 PM
LinuxTom Offline
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.
Reply With Quote
  #4  
Old 17th March 2009, 06:39 PM
LinuxTom Offline
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.

Code:
touch /.autofsck
nash will run the file check when you reboot, saves a lot of headache.
Reply With Quote
  #5  
Old 17th March 2009, 07:15 PM
kalashinaia Offline
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?
Reply With Quote
  #6  
Old 17th March 2009, 08:13 PM
sideways's Avatar
sideways Offline
Retired User
 
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
it should be

Code:
touch /forcefsck
Reply With Quote
  #7  
Old 18th March 2009, 01:07 AM
kalashinaia Offline
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?
Reply With Quote
  #8  
Old 18th March 2009, 01:33 AM
sideways's Avatar
sideways Offline
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.
Reply With Quote
  #9  
Old 18th March 2009, 01:42 AM
marko's Avatar
marko Offline
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.
Reply With Quote
  #10  
Old 18th March 2009, 05:43 PM
LinuxTom Offline
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
Reply With Quote
Reply

Tags
e2fsck, encrypted, filesystem

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Resize an encrypted root filesystem (volume) AnimeFreak Security and Privacy 0 25th January 2009 02:52 AM
Help! Can't access encrypted filesystem after upgrade! enko Using Fedora 7 6th October 2008 10:06 AM
superblock filesystem error e2fsck spacelobsters Using Fedora 1 2nd July 2006 06:34 PM


Current GMT-time: 18:13 (Tuesday, 21-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat