[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: No sudo, no root, on a fully encrypted LVM filesystem



Am 30.01.2011 20:14, schrieb David Starner:
> I've managed to remove suid bits from all the files in my /usr/bin
> directory. As I have no root password, and I have a fully encrypted
> LVM filesystem, I'm at loss at how to recover them without deleting
> everything and starting all over. (It's not a disastrous option, I
> guess, since it's a fairly fresh install, but I'd rather not.) If I
> backed up the / partition, reformatted and restored it to an
> unencrypted partition that I could edit from a bootable disk, would
> that work, or would LVM get in my way?
> 

Of course, you can also mount your encrypted lvm from a live-system and
chroot into it to repair your files. I am using encrypted LVM for about
a year now and i sometimes do that. I prepared a small script that is
saved in my /boot to easily manage that.
You have to do the following steps:

cryptsetup luksOpen /dev/sdaX tmp
vgchange -a y
cryptsetup luksOpen /dev/mapper/<name_of_the_vg> <name_of_the_vg>
mount /dev/mapper/<name_of_the_vg> mountpoint

For me, that looks like:
cryptsetup luksOpen /dev/sda6 tmp
vgchange -a y
cryptsetup luksOpen /dev/mapper/eeepc-root root
cryptsetup luksOpen /dev/mapper/eeepc-home home
mkdir /mnt/mapper/root
mkdir /mnt/mapper/home
mount /dev/mapper/root /mnt/mapper/root
mount /dev/mapper/home /mnt/mapper/home

After doing that, you can access the files, chroot into /mnt/mapper/root
etc.


Reply to: