Page 4 of 4 FirstFirst ... 234
Results 31 to 34 of 34

Thread: Create RAID 1 array with new disk

  1. #31
    Join Date
    Feb 2013
    Beans
    29

    Re: Create RAID 1 array with new disk

    Well, I want to do as much while the server is hot as possible, because downtime is just painful for everyone. So if moving the partitions around is going to cause as much downtime as it has, I'd like to avoid it and waste some space. I'd also rather copy the partitions auto-magically so everything matches up perfectly.

    If I can re-size the partitions on sda in one live session or while running hot, I would do that.

    Code:
    sudo sfdisk -d /dev/sda | sfdisk /dev/sdb
    sudo mdadm --create /dev/md0 --level=1 --raid-devices=2 missing /dev/sda1
    sudo mdadm --add /dev/md0 /dev/sdb1

  2. #32
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    13,318
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Create RAID 1 array with new disk

    I'm confused. The first step was to partition the newly added disk and create md array on it. Why would that involve any downtime?

    You are running from sda, business as usual, and you are partitioning sdb. Later creating the md device which doesn't involve downtime either.

    The only part where it might be better to run in live mode, is the copying, so that you are sure that files are not changing while copying. But you can do the copying while hot with rsync too. Not sure if that copies 100% while running from sda though.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 14.04 LTS 64bit & Windows 10 Pro 64bit

  3. #33
    Join Date
    Feb 2013
    Beans
    29

    Re: Create RAID 1 array with new disk

    what if, instead I:
    removed the cryptswap (sda5)
    shrunk sda2
    set sda2 to be the swap
    increased the size of sda1 using gparted in a live session
    copied the partition tables from sda to sdb
    create a RAID array missing sdb
    add sdb to the RAID array

    Then I don't have to muck around with boot configuration or copy anything from sda to sdb.

  4. #34
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    13,318
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Create RAID 1 array with new disk

    You can't create the raid on the same disk where the data is right now. It will format it during creation of the md device.

    The only way to move from single disk to mdadm raid1, is to partition the new disk (this doesn't involve downtime since you are not using it), create md device with this new disk and missing the first one, copy data, try to boot from the array and run from it to confirm it works, and then add the old (first) disk to the array and let it sync.

    I think your procedure was correct only that during the first copy it powered off or what ever, and this is what created issues.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 14.04 LTS 64bit & Windows 10 Pro 64bit

Page 4 of 4 FirstFirst ... 234

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •