CrownCloud Wiki

CrownCloud - Internet Services

User Tools

Site Tools


easy_accessing_raid_and_lvm_partitions_from_linux_rescuemode

Easy Accessing RAID and LVM Partitions from Linux RescueMode

By h0cin @ #crowncloud on irc.freenode.net

$ ssh root@y.z.q.x
The authenticity of host 'y.z.q.x (y.z.q.x)' can't be established.
RSA key fingerprint is 87:97:37:c9:bb:c9:e2:22:f7:f5:02:07:b8:ec:23:13.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'y.z.q.x' (RSA) to the list of known hosts.
root@y.z.q.x's password: 

      _____                                          _                 
     |  __ \                                        | |                
     | |__) |___  ___  ___ _   _  ___  ___ _   _ ___| |_ ___ _ __ ___  
     |  _  // _ \/ __|/ __| | | |/ _ \/ __| | | / __| __/ _ \ '_ ` _ \ 
     | | \ \  __/\__ \ (__| |_| |  __/\__ \ |_| \__ \ ||  __/ | | | | |
     |_|  \_\___||___/\___|\__,_|\___||___/\__, |___/\__\___|_| |_| |_|
                                            __/ |                      
                                           |___/                       


rescue64:~# ls -lh /
insgesamt 36K
drwxr-xr-x  2 root root 2,0K 16. Jul 2010  bin
drwxr-xr-x  2 root root 1,0K 16. Jul 2010  boot
drwxr-xr-x 15 root root  14K 26. Jul 00:35 dev
drwxr-xr-x  3 root root 1,0K 16. Jul 2010  emul
drwxr-xr-x 60 root root 3,0K 26. Jul 00:35 etc
drwxr-xr-x  2 root root 1,0K 16. Jul 2010  home
drwxr-xr-x 10 root root 3,0K 16. Jul 2010  lib
lrwxrwxrwx  1 root root   20 16. Jul 2010  lib32 -> /emul/ia32-linux/lib
lrwxrwxrwx  1 root root    4 16. Jul 2010  lib64 -> /lib
drwx------  2 root root  12K 16. Jul 2010  lost+found
drwxr-xr-x  2 root root 1,0K 16. Jul 2010  media
drwxr-xr-x  2 root root 1,0K 16. Jul 2010  mnt
drwxr-xr-x  2 root root 1,0K 16. Jul 2010  opt
dr-xr-xr-x 81 root root    0 25. Jul 08:39 proc
drwxr-xr-x  3 root root 1,0K 25. Jul 08:40 root
drwxr-xr-x  2 root root 4,0K 25. Aug 2010  sbin
drwxr-xr-x  2 root root 1,0K 16. Jul 2010  selinux
drwxr-xr-x  2 root root 1,0K 16. Jul 2010  srv
drwxr-xr-x 13 root root    0 25. Jul 08:39 sys
drwxr-xr-t  4 root root 1,0K 21. Jul 2010  tmp
drwxr-xr-x 11 root root 1,0K 16. Jul 2010  usr
drwxr-xr-x 13 root root 1,0K 16. Jul 2010  var
rescue64:~# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0000e05e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   fd  Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sda2              26       60802   488180736   fd  Linux raid autodetect

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000516c7

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          26      204800   fd  Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sdb2              26       60802   488180736   fd  Linux raid autodetect
rescue64:~# mount
/dev/ram0 on / type ext2 (rw)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
rescue64:~# mdadm --examine --scan
ARRAY /dev/md/0 level=raid1 metadata=1.0 num-devices=2 UUID=3f58083e:cf09a51c:38039a5c:1e1fc34a name=localhost.localdomain:0
ARRAY /dev/md/1 level=raid0 metadata=1.1 num-devices=2 UUID=a8c5c4bb:e53837da:10c5b685:4367e9ef name=localhost.localdomain:1
rescue64:~# mdadm --examine --scan >> /etc/mdadm/mdadm.conf
rescue64:~# mdadm --assemble --scan
/dev/md0: File exists
mdadm: /dev/md/0 has been started with 2 drives.
mdadm: /dev/md/1 has been started with 2 drives.
rescue64:~# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0000e05e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   fd  Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sda2              26       60802   488180736   fd  Linux raid autodetect

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000516c7

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          26      204800   fd  Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sdb2              26       60802   488180736   fd  Linux raid autodetect

Disk /dev/md0: 209 MB, 209702912 bytes
2 heads, 4 sectors/track, 51197 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000

Disk /dev/md0 doesn't contain a valid partition table

Disk /dev/md1: 999.7 GB, 999792050176 bytes
2 heads, 4 sectors/track, 244089856 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000

Disk /dev/md1 doesn't contain a valid partition table
rescue64:~# cat /etc/fstab 
proc            /proc           proc    defaults        0       0
/dev/ram0       /               ext2    defaults        0       0
rescue64:~# cat /etc/fstab 
proc            /proc           proc    defaults        0       0
/dev/ram0       /               ext2    defaults        0       0
rescue64:~# pvscan 
  PV /dev/md1   VG VolGroup   lvm2 [931,12 GB / 0    free]
  Total: 1 [931,12 GB] / in use: 1 [931,12 GB] / in no VG: 0 [0   ]
rescue64:~# vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "VolGroup" using metadata type lvm2
rescue64:~# lvscan
  inactive          '/dev/VolGroup/LogVolSWAP' [2,00 GB] inherit
  inactive          '/dev/VolGroup/LogVol01' [48,83 GB] inherit
  inactive          '/dev/VolGroup/LogVol02' [880,30 GB] inherit
rescue64:~# vgchange -a y VolGroup
  3 logical volume(s) in volume group "VolGroup" now active
rescue64:~# lvscan
  ACTIVE            '/dev/VolGroup/LogVolSWAP' [2,00 GB] inherit
  ACTIVE            '/dev/VolGroup/LogVol01' [48,83 GB] inherit
  ACTIVE            '/dev/VolGroup/LogVol02' [880,30 GB] inherit
rescue64:~# mount /dev/mapper/VolGroup-LogVol01 /mnt
rescue64:~# cd /mnt/
rescue64:/mnt# ls
bin   cgroup  etc   lib    lost+found  misc  net  proc	sbin	 srv  tmp  var
boot  dev     home  lib64  media       mnt   opt  root	selinux  sys  usr
easy_accessing_raid_and_lvm_partitions_from_linux_rescuemode.txt · Last modified: 2013/03/25 12:13 by speedbus