1

I have 2 128GB SSDs on Asus Zenbook.

I tried to boot into Ubuntu live CD (try Ubuntu) and create RAID from:

enter image description here

Then tried to instal uUbuntu, but it fails to install grub on RAID.

Another solution I tried is to install Ubuntu to one SSD, then boot from live CD and create RAID from disks app again, and it rsyncs disks, but after reboot newly created RAID array dissapears.

Is there any solution to setup RAID0 preferrably or RAID1 on my desktop?

UPDATE

Following Slimmons answer, I ended up with error after I tried to dpkg-reconfigure grub-pc:

enter image description here

I also failed to do this from the first time because I was unable to install grub-pc package for some reason (could not resolve host...), so I just did it next time first.

Also, when I install Ubuntu on spare HDD, I create boot EFI partition as well, so it appears in fstab with UUID, what should we do with that?

3
  • Can you try with the Server edition? You can always select Ubuntu Desktop when asked for software selection.
    – muru
    Sep 11, 2014 at 19:49
  • @muru Server edition see only sda disk, only one :0
    – umpirsky
    Sep 11, 2014 at 20:56
  • 1
    Possible duplicate of Installing Ubuntu 14.04 on Asus Zenbook (RAID)
    – umpirsky
    Dec 18, 2015 at 9:59

1 Answer 1

1

Assuming I understood your question correctly, this should help. It was taken from here. and was originally written for Mint.

Install ubuntu on a spare drive

I will assume your two ssd's show as sda and sdb (adjust instructions to match what your drives actually are marked as) I'll also assume that your two drives have no unallocated space

First, don't set any RAID options in BIOS. They're not needed. Set the ports to AHCI.

With all HD's connected, start the machine and boot into the Ubuntu you've installed on sdd. Install mdadm:

$ sudo apt-get install mdadm

The install script will ask you about email. Choose "No configuration".

Next, setup the partitions:

$ gksu gparted

Choose either of the two disks you want to RAID. I assume /dev/sda. Create an msdos partition table on /dev/sda. You'll find instructions here

I run without swap so I don't do this next step. Create a primary partition (instructions) and set it to a size equal to half your RAM plus half again just in case. Make sure the partition is marked as 'linux swap'.

Next, create a primary partition (I use the entire disk) on the same device and mark it as 'unformatted'. I don't see the point in partitioning a RAID0 set because if the array goes down you've lost the lot anyway.

Apply the changes (Instructions)

At this point you have one device with these partitions: /dev/sda1 (marked as swap, unformatted) /dev/sda2 (unformatted)

Now, that last huge partition you created on /dev/sda2, change its flag to 'raid'(Instructions)

Apply the changes again then quit back to the terminal. Next, mirror the partition table from /dev/sda, which you just partitioned, over to the other disk in the RAID set, /dev/sdb:

$ sudo sh -c "sfdisk -d /dev/sda | sfdisk /dev/sdb"

At this point you have two separately partitioned devices with these partitions: /dev/sda1 (marked as swap, unformatted) /dev/sda2 (unformatted) /dev/sdb1 (marked as swap, unformatted) /dev/sdb2 (unformatted)

Now we create the RAID0 set and capture the configuration information:

$ sudo mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sd[ab]2
$ sudo sh -c "mdadm -Ds >> /etc/mdadm/mdadm.conf"

Next, create the swap and do the deed to /dev/md0:

$ sudo mkswap /dev/sda1
$ sudo mkswap /dev/sdb1
$ sudo mkfs.ext4 /dev/md0

Now we mount the RAID0 set. We'll use /mnt because Ubuntu uses /media and I don't want to go creating directories on your filesystem, so:

$ sudo mount /dev/md0 /mnt

Now we rsync the current installation to the RAID set:

$ sudo rsync -avx / /mnt/

/ is the root of the Ubuntu you installed on the spare drive and booted to at the start of this tutorial.

Now we need to get the UUIDs for /dev/md0 (the RAID set), and for each disk in the set:

$ sudo blkid

We have to do this because both disks in the set will have to be mounted before we can mount the RAID set. so, you should have a list that looks similar to this:

/dev/sda1: UUID="fcb1b870-206c-9606-d2b6-f7ece3af251c" UUID_SUB="7983c3c6-861c-f131-fdcd-0731215a615f" LABEL="fsck-me-dead:0" TYPE="linux_raid_member"
/dev/sdb1: UUID="fcb1b870-206c-9606-d2b6-f7ece3af251c" UUID_SUB="0c4ab68d-2366-ad4f-8943-4bad2a82ca59" LABEL="fsck-me-dead:0" TYPE="linux_raid_member"
/dev/sdc1: LABEL="128GB_HDD" UUID="0002e9d5-5d5c-450e-82ca-9fdbd7b6c779" TYPE="ext4"
/dev/md0: UUID="bd9f2f44-96e6-4647-b0f4-af22718a7faa" TYPE="ext4"

It might be easier if you open another terminal session and do sudo blkid there so you can see the information easier.

$ gksu gedit /mnt/etc/fstab

Now the tricky bit... your fstab will have a UUID for / (root). replace that UUID with the UUID listed above from the blkid command that belongs to /dev/md0. So, in my case I would replace the UUID for / with this:

bd9f2f44-96e6-4647-b0f4-af22718a7faa

Don't forget that that line above is my UUID, not yours. It's an example only.

Next, locate the UUID for swap in your fstab and replace that UUID with the UUID from /dev/sda1. Do the same for the other swap partition using the UUID from /dev/sdb1. I can't give you an example here because, as I said, I don't use swap.

If you've been following this and making sense of it you'll be right in suspecting that we have created two unformatted partitions that have the same UUID. That is, the UUID for /dev/sda1 is the same UUID for /dev/sdb1.

Now we have to chroot into the Ubuntu we just copied to the RAID set so we can get it to boot by setting up GrUB:

$ for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done
$ sudo chroot /mnt
$ update-initramfs -u
$ dpkg-reconfigure grub-pc

Once you're in there, your command line prompt will change colour. Mine goes red.

A text-based dialog will open. Deselect the default entry and select /dev/md0. You do this by pressing the spacebar. When the RAID set has been selected, press tab then press enter on Ok.

If all went well, you can exit the chroot:

$ exit
$ for i in /dev/pts /dev /proc /sys; do sudo umount /mnt$i; done

Shut the machine down and remove that spare drive you first installed to. Start the machine up again and you should see your shiny new RAID set announced by GruB as /dev/md0. You can breathe and smile now if you like, but with me being a grumpy old bugger I skip that last step and kick the cat instead.

There will be some minor housekeeping you'll have to do. I can't recall what it was I had to do. I think nemo complained. well, something did. All I did was point it in the right direction by setting the correct path. You'll know what I mean when the errors pop up. There's only one or two and they're minor, they're also due to the rsync we did, fyi. Once you've set the right details it should all run like a bought one.

7
  • Thanks for detailed instructions @Slimmons! I will try it this weekend.
    – umpirsky
    Sep 17, 2014 at 9:19
  • No problem. It took me forever to get mine set up, and once I did it this way, I was overjoyed. Sep 17, 2014 at 18:09
  • Tryinf now. One question, why do we raid partitions in sudo mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sd[ab]2 and not entire devices, like sudo mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sd[ab]?
    – umpirsky
    Sep 21, 2014 at 18:37
  • I'm actually not sure. This is from a configuration that worked for me from someone else, as linked from above. For your grub error, you can try using boot-repair from another live disk. That could repair GRUB. Sep 22, 2014 at 20:34
  • I would have made the GRUB comment to your question at the start, but I only have 13 rep, and it requires 50.. :) Sep 22, 2014 at 20:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .