How do I run fsck on an encrypted partition?

Hi,

One of the encrypted partitions in my OpenSuSE 11.0 system has apparently become damaged and no longer mounts at boot time after its password is supplied. How can I get it into the appropriate state to do filesystem repairs on it? I can’t find anything pertinent in the SuSE Help system.

Here’s what I see:

dmesg:

device-mapper: uevent: version 1.0.3
device-mapper: ioctl: 4.13.0-ioctl (2007-10-18) initialised: dm-devel@redhat.com
loop: module loaded
kjournald starting. Commit interval 5 seconds
EXT3 FS on sda1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
ohci_hcd: 2006 August 04 USB 1.1 ‘Open’ Host Controller (OHCI) Driver
padlock: VIA PadLock not detected.
padlock: VIA PadLock Hash Engine not detected.
SGI XFS with ACLs, security attributes, realtime, large block numbers, no debug enabled
SGI XFS Quota Management subsystem
Filesystem “dm-0”: Disabling barriers, not supported by the underlying device
XFS mounting filesystem dm-0
Starting XFS recovery on filesystem: dm-0 (logdev: internal)
00000000: 4e 49 a4 81 02 02 00 00 e8 03 00 00 64 00 00 00 NI…d…
Filesystem “dm-0”: XFS internal error xlog_recover_do_inode_trans(5) at line 2380 of file fs/xfs/xfs_log_recover.c. Caller 0xe131b1cd
Pid: 1575, comm: mount Tainted: G N 2.6.25.5-1.1-pae #1
<c01071d9>] dump_trace+0x63/0x227
<c0107c8a>] show_trace+0x15/0x29
<c02e84b5>] _etext+0x5b/0x65
<e13085cf>] xfs_error_report+0x2c/0x2e [xfs]
<e1308606>] xfs_corruption_error+0x35/0x40 [xfs]
<e131acc5>] xlog_recover_do_inode_trans+0x36b/0x6b1 [xfs]
<e131b1cd>] xlog_recover_do_trans+0x5b/0xea [xfs]
<e131b281>] xlog_recover_commit_trans+0x25/0x39 [xfs]
<e131b3b5>] xlog_recover_process_data+0x120/0x194 [xfs]
<e131be5c>] xlog_do_recovery_pass+0x321/0x8a5 [xfs]
<e131c454>] xlog_do_log_recovery+0x74/0x9c [xfs]
<e131c48f>] xlog_do_recover+0x13/0xe1 [xfs]
<e131d594>] xlog_recover+0x75/0x89 [xfs]
<e1318721>] xfs_log_mount+0xb0/0xff [xfs]
<e131fce1>] xfs_mountfs+0x291/0x557 [xfs]
<e1325d1c>] xfs_mount+0x24d/0x2e9 [xfs]
<e13332cd>] xfs_fs_fill_super+0xaa/0x1c6 [xfs]
<c017bc1b>] get_sb_bdev+0xdd/0x11a
<e1332366>] xfs_fs_get_sb+0x13/0x15 [xfs]
<c017b907>] vfs_kern_mount+0x82/0xf5
<c017b9be>] do_kern_mount+0x32/0xba
<c018d81d>] do_new_mount+0x42/0x6c
<c018e4ca>] do_mount+0x179/0x197
<c018e54e>] sys_mount+0x66/0xa0
<c01059e4>] sysenter_past_esp+0x6d/0xa9
<ffffe430>] 0xffffe430

Filesystem “dm-0”: xfs_inode_recover: Bad inode log record, rec ptr 0xde5d1dc0, dino ptr 0xdd93d400, dino bp 0xdf819460, ino 1963588, total extents = -1, nblocks = -4
XFS: log mount/recovery failed: error 117
XFS: log mount failed
Filesystem “dm-0”: Disabling barriers, not supported by the underlying device
XFS mounting filesystem dm-0
Ending clean XFS mount for filesystem: dm-0
Filesystem “dm-1”: Disabling barriers, not supported by the underlying device
XFS mounting filesystem dm-1
Starting XFS recovery on filesystem: dm-1 (logdev: internal)
Ending XFS recovery on filesystem: dm-1 (logdev: internal)
Filesystem “dm-2”: Disabling barriers, not supported by the underlying device
XFS mounting filesystem dm-2
Ending clean XFS mount for filesystem:
dm-2/dev/mapper/cr_sdb1 /home/turriff xfs noauto 0 0

Here’s my /etc/fstab:

/dev/disk/by-id/scsi-SATA_WDC_WD136AA_WD-WM6780362395-part3 swap swap defaults 0 0
/dev/disk/by-id/scsi-SATA_WDC_WD136AA_WD-WM6780362395-part2 / ext3 acl,user_xattr 1 1
/dev/disk/by-id/scsi-SATA_WDC_WD136AA_WD-WM6780362395-part1 /boot ext3 acl,user_xattr 1 2
/dev/mapper/cr_sdc2 /tmp xfs noauto 0 0
/dev/mapper/cr_sdc1 /var xfs noauto 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

and here’s my /etc/crypttab:

cr_sdb1 /dev/disk/by-id/scsi-SATA_WDC_WD400BB-00LWD-WCANA1013966-part1 none none
cr_sdc2 /dev/disk/by-id/scsi-SATA_IBM-DHEA-38451_SH0SH0Y3373-part2 none none
cr_sdc1 /dev/disk/by-id/scsi-SATA_IBM-DHEA-38451_SH0SH0Y3373-part1 none none

Hoping for some help with this. :slight_smile:

Leslie

Boot Suse.
Mount the volume without a mount point:
truecrypt /home/user/whatever
Then list mounted volumes.
truecrypt -l
The output will be:
/dev/mapper/truecrypt0 (or whatever)
Then do an fsck.
fsck /dev/mapper/truecrypt0
And it will check the volume.

fsck will do nothing on XFS file systems. You need to use xfs_repair

Hmmm…never heard of truecrypt before. I can use it with an encrypted partition created by YaST?

Yes, xfs-repair, not fsck.

Leslie

Okay, I installed truecrypt and followed your instructions:

> truecrypt /home/turriff

truecrypt popped up a password window, and after I entered the password I got a message, “Is a directory: /home/turriff [OK]”

I also tried

> truecrypt /dev/sdb1

and after the password prompt I got the message, “Incorrect password or not a TrueCrypt volume. [OK]”

This partition was created by YaST’s partitioner. How would I make it accessible to xfs_repair without using truecrypt?

Leslie

Should I be posting to a different forum for YaST questions?

Leslie

The previous level I was using (OpenSuSE 10.3, IIRC) used losetup. Can I revert to that to prepare to use xfs_repair?

Leslie

Okay, after trying numerous search combinations, I finally discovered
Encrypted Filesystems - openSUSE
which tells me that cryptsetup is what I was looking for.

Thanks for your help.

Leslie