[mdlug] SuSE root breakin help needed

Jeff Hanson jhansonxi at gmail.com
Mon May 26 15:21:03 EDT 2008


On Mon, May 26, 2008 at 12:19 PM, Jay Nugent <jjn at nuge.com> wrote:
>   Can't seem to get the hard drive mounted after trying all sorts of
> permutations of fstab.  I don't know the exact partitioning of the hard
> drive but *seem* to recall it was basically three partitions, /, /home,
> and swap, and that it is a SATA drive.  But I can't recall whether it had
> LVM turned on or not, and I have NO idea how to deal with LVM *if* it was
> turned on.
>
>   I can't keep trying different config lines in /etc/fstab endlessly and
> blindly.  Anyone have some suggestions how best to procede??

If you can boot the system off the drive and log in with any account
then "cat /proc/mounts" should indicate what is mounted where.

I've been working on Ubuntu with MD/RAID, LVM, and LUKS/dm-crypt and
this script is what I use with the LiveCD to access an encrypted
system and fix grub problems:

recover.sh:
#! /bin/bash
# Quick one-shot, run as superuser
apt-get install mdadm lvm2 cryptsetup && modprobe dm-mod && mdadm -As
&& vgchange -ay && cryptsetup luksOpen /dev/mapper/vg0-lv0 lv0_crypt
&& mkdir /ubuntu && mount /dev/mapper/lv0_crypt /ubuntu && mount
/dev/md0 /ubuntu/boot && mount -t proc none /ubuntu/proc && mount -o
bind /dev /ubuntu/dev && chroot /ubuntu && cd /boot/grub

Basically:
1.  Install mdadm, lvm2 and cryptsetup
2.  Load the dm-mod for RAID and use mdadm to scan for and mount any
RAID devices.
3.  Use vgchange to scan for and activate any LVM volume groups and devices.
4.  Use cryptsetup to unlock the root encrypted volume on logical
volume 0 of volume group 0 (vg0 and lv0 follow my device naming
convention)  and call it lv0_crypt.
5.  Make a directory /ubuntu (effectively within the LiveCD ram drive).
6.  Mount the unlocked lv0_crypt volume at /ubuntu.
7.  Mount /dev/md0 (unencrypted boot volume) as /ubuntu/boot
8.  Mount the LiveCD's /proc and /dev directories in /ubuntu.
9.  chroot /ubuntu so everything will be using the apps from the drive
instead of the outdated LiveCD.

Then I proceed to beat grub into submission like getting the drive #s
for the RAID set correctly.  Ubuntu's installer has a lot of problems
with RAID, LVM, and dm-crypt, especially when used in combination.

I think the vgchange -ay command is what you are looking for if it's an LVM.



More information about the mdlug mailing list