Enterprise Linux

 View Only
  • 1.  Migrate SLES12 root on btrfs to new disk

    Posted 26 days ago

    Hello,

    We have a number of SLES12 LPARs which, by default, have the root file system on btrfs

    We're migrating to newer storage so we're looking at how we can migrate the btrfs root file system to the new disk.

    My preference would be to use the storage to migrate the boot volume but this will change the UUID of the boot volume and prevent the LPAR from booting.

    What is the safest method of migrating a btrfs volume to a new disk



    ------------------------------
    Glenn Robinson
    ------------------------------


  • 2.  RE: Migrate SLES12 root on btrfs to new disk

    Posted 26 days ago
    Edited by Andre Lutz 26 days ago

    Hello Glenn,

    There are many ways in the Linux environment. 
    BTRFS is already good for updates from SLES Update. -> Inplace Update, because BTRFS works with snapshots and you can rollback with snapper command. 

    To migrate to another disk, the best combination is LVM + BTRFS. 

    Can you send me the output of this command? (root disk) 

    lsblk -o name,type,fstype,size,mountpoint,uuid



    ------------------------------
    Andre Lutz
    ------------------------------



  • 3.  RE: Migrate SLES12 root on btrfs to new disk

    Posted 26 days ago
      |   view attached

    Thanks Andre.

    i have uploaded a file with the output you requested.



    ------------------------------
    Glenn Robinson
    ------------------------------

    Attachment(s)

    txt
    lsblk_output.txt   35 KB 1 version


  • 4.  RE: Migrate SLES12 root on btrfs to new disk

    Posted 25 days ago

    Hello Glenn,

    use lvm to move the rootvg(system) from one disk to the other.

    Here is a rough procedure. You should do this with a test system and make a backup before. 


    Reboot is also recommended. This action can be carried out while the system is running

    sfdisk -l /dev/sda > svc_bootdisk.out

    HD=sdxxx # new disk
    sfdisk $HD < svc_bootdisk.out
    blockdev --rereadpt $HD

    PV=/dev/dm-xxxx
    pvscan
    pvcreate $PV
    pvscan
    vgs
    vgextend system $PV
    pvs

    pvmove --atomic /dev/dm-old  /dev/dm-new

    # lvs -a -o +devices view
    vgreduce system /dev/dm-old
    pvremove /dev/dm-old

    grub2-install /dev/disk/by-id/dm-new-part1
    grub2-mkconfig -o /boot/grub2/grub.cfg
    systemctl daemon-reload
    mkinitrd

    bootlist -m normal sdan sdal sdaq sdai
    bootlist -m normal -r


    ------------------------------
    Andre Lutz
    ------------------------------



  • 5.  RE: Migrate SLES12 root on btrfs to new disk

    Posted 23 days ago

    Thank you, this makes sense.

    I assume the svc_bootdisk.out file does not need to be edited before using the following command?

    sfdisk $HD < svc_bootdisk.out



    ------------------------------
    Glenn Robinson
    ------------------------------



  • 6.  RE: Migrate SLES12 root on btrfs to new disk

    Posted 22 days ago

    No does not need to be edited if the hard disk is the same size and the layout should remain the same. 



    ------------------------------
    Andre Lutz
    ------------------------------