Rescue Tasks

Zuletzt geändert von H.-Dirk Schmitt am 2011/08/17 18:45

Rescue Tasks

Tips about accessing a broken system.


  1. open luks container
  2. recreate /dev/mapper/... for late opened lvm devices (e.g. encrypted)
  3. mounting an existing installation chroot
  4. mounting duplicate volume group

error Ensure that a 64bit kernel is used for rescuing a 64bit system!

open luks container

dev=sdaXX
cryptsetup luksOpen /dev/${dev} ${dev}_crypt 

The container should be opened with the same name as in /etc/crypttab.
Otherwise update-initramfs may fail with the following message:

cryptsetup: WARNING: invalid line in /etc/crypttab - 

recreate /dev/mapper/... for late opened lvm devices (e.g. encrypted)

e.g. for a crypt device opened in a rescue session

pvscan
vgchange -a y

mounting an existing installation chroot

Check the shell used by the rescue system.
E.g. system rescue cd is using zsh and not bash.
information Some code fragments below will fail under zsh. Avoid the '#' or (better) switch to the bash.
rootPartition="$(echo /dev/mapper/*-root)"
mkdir /target
mount ${rootPartition} /target

# preserve network resolution
cat /etc/resolv.conf  >/target/etc/resolv.conf

# special file systems
mount -o bind /dev /target/dev
mount -o bind /sys /target/sys
mount -t proc none /target/proc

# for grub, update-initramfs, ...
# * use correct mount table (existing is not in sync!)
# * prepend the correct view of the root partition (needed for update-initramfs)
{ echo ${rootPartition} / ext4 rw 0 0
  cat  /proc/mounts
} > /target/etc/mtab # for grub reinstallation

# switch
chroot /target /bin/bash 
mount -a # mount partitions as defined in /etc/fstab
The hostname is set by the systemrescuecd environment to sysresccd.
If needed set with hostname the correct system name.
SystemRescue 1.5.x has a problem with a chroot environment of lucid and mkinitramfs.
Please use a older version like 1.3.8.

mounting duplicate volume group

If you try to add a disk (e.g. via sata toaster) with duplicate volume group name you see an error message like this:

WARNING: Duplicate VG name system: DhkfI6-bSYQ-jF4Y-GDxa-0qoX-AGYN-U5C0Wl (created here) takes precedence over 13lkqm-b9BN-Y2wx-2wWq-wFBk-lxUN-2qtyVJ

To work around this problem you should change the volume group name like in this example:

vgrename -v 13lkqm-b9BN-Y2wx-2wWq-wFBk-lxUN-2qtyVJ other-system

error Dangerous operation: make sure you are note changing the volume group name of your actual system!

Erstellt von H.-Dirk Schmitt am 2010/02/20 16:42

Meine letzten Änderungen

Zuletzt erstellt

PDF Export


This wiki is licensed under a Creative Commons 3.0 (Attribution, ShareAlike) license
XWiki Enterprise 5.2.2 - Documentation