Other articles

  1. Restoring data from raid + lvm disks

    If you are, like me, using this kind of layout for your disks:

    disks => raid1 => lvm (encrypted or not) => partitions => filesystems
    

    (Remember never to use XFS with this layout, unless you want to be sure to loose data - XFS still has problems with the 4k stack. Also, do not use XFS if you are not using a power supply. Oh, well, remember not to use to XFS at all …)

    This setup should ensure you to keep your data safe if one of the disk crashes. Good ! But what happens if you want to take one of the disks and mount it elsewhere (for ex. with an external USB converter) ? You have to re-create the FS stack manually, which can be quite tricky, so I post the commands here:

    0 - find your disk partitions layout

    # fdisk -l /dev/sdb
    Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *           1         122      979933+  fd  Linux raid autodetect
    /dev/sdb2             123       14946   119073780   fd  Linux raid autodetect
    

    1 - Create a (degraded) raid array

    # mdadm --assemble --run /dev/md0 /dev/sdb2
    mdadm: /dev/md0 has been started with 1 drive (out of 2).
    

    2 - Scan and create the LVM volume group

    # lvmdiskscan |grep md
    /dev …
    read more

Page 1 / 1