Changes

Jump to navigation Jump to search
→‎Frequently Asked Questions: Recovering SME Server with LVM drives
Line 358: Line 358:  
*If I boot my SMESERVER with a USB hard drive attached, it doesn't recognize the drive. Any workarounds for this?
 
*If I boot my SMESERVER with a USB hard drive attached, it doesn't recognize the drive. Any workarounds for this?
 
Some USB drives need to be plugged twice into the server to be recognized.
 
Some USB drives need to be plugged twice into the server to be recognized.
 +
 +
 +
===Recovering SME Server with lvm drives===
 +
Let’s try starting the raid and see what we get:
 +
 +
mdadm -E /dev/sdb1
 +
 +
What “mdadm -E /dev/sdb1” command shows it is a part of a raid array, what level, how many members, etc.
 +
 +
user@user-desktop:/mnt$ mdadm -E /dev/sdb2
 +
/dev/sdb2:
 +
          Magic : a92b4efc
 +
        Version : 00.90.00
 +
          UUID : 550e0406:c9ce50d2:825b32e4:4a9d3549
 +
  Creation Time : Sat Sep  8 12:15:29 2007
 +
    Raid Level : raid1
 +
  Used Dev Size : 1991936 (1945.58 MiB 2039.74 MB)
 +
    Array Size : 1991936 (1945.58 MiB 2039.74 MB)
 +
  Raid Devices : 2
 +
  Total Devices : 1
 +
Preferred Minor : 2
 +
    Update Time : Sat Sep  8 12:22:05 2007
 +
          State : clean
 +
Active Devices : 1
 +
Working Devices : 1
 +
Failed Devices : 1
 +
  Spare Devices : 0
 +
      Checksum : 22e3837f - correct
 +
        Events : 0.991
 +
      Number  Major  Minor  RaidDevice State
 +
this    0      8        2        0      active sync  /dev/sda2
 +
 +
  0    0      8        2        0      active sync  /dev/sda2
 +
  1    1      0        0        1      faulty removed
 +
user@user -desktop:/mnt$
 +
 +
With it being a raid 1 we only need 1 member to start it.
 +
 +
You can also use any md device to assemble the array.  You need to make sure you are using an md device that isn't already in use, to check what isn’t being used type:
 +
 +
cat /proc/mdstat
 +
 +
So we have now found which md device we can use and for our example we will use “md8”
 +
 +
What we will do now is assemble and run the array:
 +
 +
mdadm -AR /dev/md8 /dev/sdb2
 +
 +
If you have multiple arrays you will need to assemble and run:
 +
 +
mdadm -AR /dev/md8 /dev/sdb2 /dev/sdd2 /dev/sde3
 +
 +
Now see if the array is assembled:
 +
 +
user@user-desktop: ~$ lvs
 +
  LV  VG  Attr  LSize  Origin Snap%  Move Log Copy%
 +
  root main -wi-ao  1.53G
 +
  swap main -wi-a- 320.00M
 +
user@user-desktop: ~$
 +
 +
To activate all known volume groups in the system:
 +
 +
user@user-desktop:~$ vgchange main -a n
 +
  0 logical volume(s) in volume group "main" now active
 +
user@user-desktop:~$ vgchange main -a y
 +
  2 logical volume(s) in volume group "main" now active
 +
user@user-desktop:~$
 +
 +
Now we should be able to mount the drive:
 +
 +
user@user-desktop:~$ mount /dev/main/root /mnt/oldsmeserver/
 +
user@user-desktop:~dev$
 +
 +
Looking good so let’s show where our files are:
 +
 +
user@user-desktop:~$ cd /mnt/oldsmeserver/
 +
user@user-desktop:/mnt/oldsmeserver$ dir
 +
aquota.group  boot    etc    lib        mnt      proc  selinux  sys  var
 +
aquota.user  command  home    lost+found  opt      root  service  tmp
 +
bin          dev      initrd  media      package  sbin  srv      usr
 +
user@user-desktop:/mnt/oldsmeserver$
 +
 +
Now you have successfully assembled your array and able to recover your data.
 +
    
===Backups & Restores===
 
===Backups & Restores===

Navigation menu