LVM: Mount LVM Partition(s) in Rescue Mode

LVM: Mount LVM Partition(s) in Rescue Mode


# When system is not able to boot up due to OS problems we may be leaded to boot it into
# Rescue Mode using a installation CD.

# While booting in this mode, system will try to find out linux installation and mount it
# under /mnt/sysimage giving us the opportunity of getting to F.S. in order to make
# appropriate modifications for system to be recovered. Sometimes, if OS is seriously
# damaged this is not possible. In this case, it may be useful to manually mount LVM
# partitions to check/modify OS to recover server.


# Boot the machine with installation CD into Rescue Mode.

sh-3.2# df -k
   Filesystem                1K-blocks        Used     Available  Use%   Mounted on
   /dev                         517568           0        517568    0%   /dev
   /tmp/loop0                   109184      109184             0  100%   /mnt/runtime

sh-3.2# vgs
   sh: vgs: command not found

sh-3.2# pvscan
   sh:  pvscan: command not found


# We get this kind of errors because lvm commands are not available in Rescue Mode.
# Instead we will precede any lvm commands by "lvm" command this way:

sh-3.2# lvm vgs
   VG    #PV  #LV  #SN  Attr      VSize    VFree
   vg00    1    7    0  wz--n-    31.50G      0


 
# Now we are ready to use lvm commands so we can mount our lvm volumes

# Check existing logical volumes

sh-3.2# lvm lvs
   LV      VG    Attr    LSize  Origin Snap%  Move Log Copy%  Convert
   lvhome  vg00  -wi---  4.50G
   lvopt   vg00  -wi---  5.00G
   lvroot  vg00  -wi---  5.00G
   lvswap  vg00  -wi---  5.00G
   lvtmp   vg00  -wi---  2.00G
   lvusr   vg00  -wi---  5.00G
   lvvar   vg00  -wi---  5.00G


# Activate our root volume group

sh-3.2# lvm vgchange -a y vg00
  7 logical volume(s) in volume group "vg00" now active

# Mount any desired volume, in this case "/" filesystem
 
sh-3.2# mkdir /mnt/temp
sh-3.2# mount /dev/vg00/lvroot /mnt/temp

# Now we are able to access our OS data to make any needed check/modification
5 (1)
Article Rating (1 Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
RHEL: Extending the maximum inode count on a ext2/ext3/ext4 filesystem
Viewed 3230 times since Sun, May 27, 2018
Linux PAM configuration that allows or deny login via the sshd server
Viewed 1934 times since Wed, Oct 3, 2018
Find All Large Files On A Linux System
Viewed 2197 times since Mon, Oct 29, 2018
zabbix linux How to solve apache error No space left on device: Cannot create SSLMutex
Viewed 2401 times since Wed, Nov 11, 2020
how to list all hard disks in linux from command line
Viewed 3543 times since Mon, Jan 28, 2019
RHEL: Forgotten ’root’ password / using single-user to gain access
Viewed 7408 times since Sat, Jun 2, 2018
RHCS6: Reduce a Global Filesystem 2 (GFS2)
Viewed 3399 times since Sun, Jun 3, 2018
Open SSL Encrypt & Decrypt Files With Password Using OpenSSL
Viewed 8171 times since Mon, Feb 18, 2019
LVM: Create a new Logical Volume / Filesystem
Viewed 2084 times since Sat, Jun 2, 2018
ubuntu How to Reset Forgotten Passwords in Ubuntu 16.04
Viewed 3327 times since Tue, Dec 8, 2020