Quantcast
Channel: Admins Goodies » luks
Viewing all articles
Browse latest Browse all 3

Using fsck to check and repair LUKS encrypted disk?

$
0
0

Question

My Ubuntu 11.04 machine uses LUKS encryption for root, swap and home. A routine fsck -n revealed a set of errors I need to repair. fsck requires to unmount the partitions. Before luks I would simply boot from a USB stick and fix run fsck from there. What are the steps to do that for LUKS encrypted partitions?

Asked by stwissel

Answer

The exact method depends on how you have setup luks, and if you have LVM on top of luks or if you just have a filesystem within the luks volume.

If you don’t have LVM in addition to luks then you would probably do something like this.

cryptsetup luksOpen /dev/rawdevice somename
fsck /dev/mapper/somename# orcryptsetup luksOpen /dev/sda2 _dev_sda2
fsck /dev/mapper/_dev_sda2

If you used the LVM on LUKS option providied by the Debian/Ubuntu installer, then you’ll need to start up LVM. So vgchange -aly after opening the encrypted volume, then run fsck against the /dev/mapper/lvname.

Answered by Zoredache

Viewing all articles
Browse latest Browse all 3

Trending Articles