Raid-0 looks ok?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
janivee
Level 1
Level 1
Posts: 14
Joined: Tue Aug 30, 2016 11:27 am

Raid-0 looks ok?

Post by janivee » Thu Jan 12, 2017 6:34 am

I decided to install new Mint 18.1 to my old SSDs using raid-0 option from my motherboard to get +700MB/s read speeds with no redundancy.

64GB SSD + 64GB SDD = 128GB RAID-0 (made with motherboards raid tool, Intel Rapid Storage Technology; ctrl+i at boot).

Motherboard is: ASRock Z68 Extreme3 Gen3 Intel Z68

- 2 x SATA3 6.0 Gb/s connectors, support RAID (RAID 0, RAID 1, RAID 10, RAID 5, Intel® Rapid Storage and Intel® Smart Response Technology), NCQ, AHCI and Hot Plug functions (SATA3_1 connector is shared with eSATA3 port)
- 4 x SATA2 3.0 Gb/s connectors, support RAID (RAID 0, RAID 1, RAID 10, RAID 5, Intel® Rapid Storage and Intel® Smart Response Technology), NCQ, AHCI and Hot Plug functions

Partition tables and partitions are made with fdisk and bootable flag set with GParted.
For unknown reason fdisk's "toggle a bootable flag" didn't booted up the system after install.

sudo fdisk /dev/sda

Code: Select all

Disk /dev/sda: 59,6 GiB, 64023257088 bytes, 125045424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x7d67dddc

Device     Boot    Start       End   Sectors  Size Id Type
/dev/sda1  *        2048   1050623   1048576  512M 83 Linux /boot
/dev/sda2        1050624  42993663  41943040   20G 83 Linux /root
/dev/sda3       42993664  76548095  33554432   16G 82 Linux swap / Solaris
/dev/sda4       76548096 249979391 173431296 82,7G 83 Linux /home
sudo fdisk /dev/sdb

Code: Select all

Disk /dev/sdb: 59,6 GiB, 64023257088 bytes, 125045424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x557a7718
sudo fdisk -l /dev/mapper/isw_chgfbhadgi_SSD-RAID0

Code: Select all

Disk /dev/mapper/isw_chgfbhadgi_SSD-RAID0: 119,2 GiB, 127989448704 bytes, 249979392 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 131072 bytes / 262144 bytes
Disklabel type: dos
Disk identifier: 0x7d67dddc

Device                                     Boot    Start       End   Sectors  Size Id Type
/dev/mapper/isw_chgfbhadgi_SSD-RAID0-part1 *        2048   1050623   1048576  512M 83 Linux
/dev/mapper/isw_chgfbhadgi_SSD-RAID0-part2       1050624  42993663  41943040   20G 83 Linux
/dev/mapper/isw_chgfbhadgi_SSD-RAID0-part3      42993664  76548095  33554432   16G 82 Linux swap
/dev/mapper/isw_chgfbhadgi_SSD-RAID0-part4      76548096 249979391 173431296 82,7G 83 Linux
I don't see any red lines when using fdisk -l, but GParted (and Parted) tells me that I have partition outside the disk.
Last partition ends before the second disk ends (and so does mapped partition). Partitions are not over each others. All ok?

Parted:

Code: Select all

Error: Can't have a partition outside the disk!
Ignore/Cancel?
Is my raid-0 setup right? I can see devices only at sda, not at sdb (should they look same since I have raid-0?)

Is Parted just telling me that one (fourth) partition is bigger than one single disk (and it continues to another disk)? Partition 4's end sector is way out of /dev/sda size since it continues at /dev/sdb; RAID-0 uses both SSDs.

Am I using motherboards raid (fake raid) system as I should (I connect SSDs to striped with it before installing linux)?
Last edited by janivee on Thu Jan 12, 2017 10:12 am, edited 2 times in total.

deepakdeshp
Level 15
Level 15
Posts: 5505
Joined: Sun Aug 09, 2015 10:00 am

Re: Raid-0 looks ok?

Post by deepakdeshp » Thu Jan 12, 2017 8:19 am

If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help, and keeps the forum clean.
Regards,
Deepak

I am using Mint 19.2 Cinnamon 64 bit with AMD A8/7410 processor . Memory 8GB

janivee
Level 1
Level 1
Posts: 14
Joined: Tue Aug 30, 2016 11:27 am

Re: Raid-0 looks ok?

Post by janivee » Thu Jan 12, 2017 10:01 am

Thank you for pointing those sites.

Seems to me that I have so called "fake raid", since I set it up first from BIOS and in Linux SSD set is reached from /dev/mapper/XXX and not from /dev/sdX?

gnome-disk-utility (Discs) shows that both 64GB drives are contents of "Intel Rapid Technology enterprise RAID members".
It shows also that 128GB Block Device is at /dev/dm-0 (including all four partitions). Benchmarking that gives +700MB/s speeds when reading (write +250MB/s).

Older RAID-1 partitions made with BIOS tools (ctrl+i) and Windows 7 seems to get /dev/sdX when mounted, so I am not yet 100% sure that I managed fully.
Maybe those RAID-1 sets get /dev/sdX because those use HPFS/NTFS/exFAT instead of EXT4 and are not mounted at start?

cat /etc/fstab

Code: Select all

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/mapper/isw_chgfbhadgi_SSD-RAID0p2 /               ext4    errors=remount-ro 0       1
/dev/mapper/isw_chgfbhadgi_SSD-RAID0p1 /boot           ext4    defaults        0       2
/dev/mapper/isw_chgfbhadgi_SSD-RAID0p4 /home           ext4    defaults        0       2
/dev/mapper/isw_chgfbhadgi_SSD-RAID0p3 none            swap    sw              0       0
/dev/mapper/isw_chgfbhadgi_SSD-RAID0p3 none            swap    sw              0      
This is my test to learn Linux, so I hope you let me know if something is wrong. I am not loosing important data testing with these two drives.

LeBoy
Level 1
Level 1
Posts: 29
Joined: Mon Sep 14, 2015 2:26 pm

Re: Raid-0 looks ok?

Post by LeBoy » Thu Jan 12, 2017 10:44 am

My experience is that Mint doesn't install well on BIOS Raids. At least not until release 17,3. That was the last time I tried :-(
I indeed have all my Mint installations running on SSD Raid-0 arrays but they are all made by software Raid using a Linux module called mdadm.
In short:
  • 1. First install Mint on a non-Raid partition.
    2. Create your Raid-0 array in Linux using mdadm.
    3. Using the Live-CD copy the newly installed Mint root partition to the Raid disk.
    4. Update your GRUB.
Note that an essential prerequisite for this to work is to have your GRUB installed on a Linux partition with mdadm pre-installed! Otherwise your GRUB will not see the mdadm Raid volumes.

I did this already several times and if you are interested in this solution I could help you set up yours.

janivee
Level 1
Level 1
Posts: 14
Joined: Tue Aug 30, 2016 11:27 am

Re: Raid-0 looks ok?

Post by janivee » Tue Jan 17, 2017 10:50 am

Things seem to have changed since 17.3, as I managed to get rid of my BIOS ("fake") RAID and installed RAID-0 system from bootable USB (Linux Mint 18.1 "Serena" - Cinnamon (64-bit)) to all my partitions. It went quite smoothly, after a while, just a few reboots with Super GRUB2 Disk to follow installation more accurately during the process and to learn. Next I am going to learn how to install GRUB2 to separate partition (/boot, sda1). Now it is at root (/).

I installed with ubiquity -b so I can install GRUB2 by myself.

This system was built on MBR/BIOS (not GPT/UEFI). BIOS is set to RAID-mode (not ACHI), since I still have few fake raids from Windows system (which work from Linux). I am not still sure if that RAID-mode is actually needed for Linux when I get rid of those old fake raids for good (and make those Linux Software RAIDs, too).

fdisk -l from sda and sdb (both identical):

Code: Select all

Device     Boot    Start       End  Sectors  Size Id Type
/dev/sda1  *        2048  41945087 41943040   20G 83 Linux 			/
/dev/sda2       41945088  58722303 16777216    8G 82 Linux swap
/dev/sda3       58722304 125045423 66323120 31,6G 83 Linux			/home
fdisk from md0, md1 and md2:

Code: Select all

Disk /dev/md0: 40 GiB, 42916118528 bytes, 83820544 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 524288 bytes / 1048576 bytes

Disk /dev/md1: 16 GiB, 17163091968 bytes, 33521664 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 524288 bytes / 1048576 bytes

Disk /dev/md2: 63,2 GiB, 67880615936 bytes, 132579328 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 524288 bytes / 1048576 b
dmesg | grep RAID:

Code: Select all

[    0.764772] ahci 0000:00:1f.2: AHCI 0001.0300 32 slots 6 ports 6 Gbps 0x3f impl RAID mode
[    1.698420] md: RAID0 configuration for md2 - 1 zone
[    1.700309] md: RAID0 configuration for md0 - 1 zone
[    1.700351] md: RAID0 configuration for md1 - 1 zone
Can you spot anything wrong here or have I really managed?

janivee
Level 1
Level 1
Posts: 14
Joined: Tue Aug 30, 2016 11:27 am

Re: Raid-0 looks ok?

Post by janivee » Sun Jan 22, 2017 10:49 am

Here is a short list of commands how I created my RAID-0 system (with separate /boot partition), you could do it with less commands to be more efficient, but this is for learning. Be careful, if you copy commands from here, sudo is powerful command and you can loose your precious data by accident!

I have sda and sdb for installation (both 64GB SSD drives).

1.) Boot from USB in legacy BIOS-mode (not the UEFI-mode)

2.) Wipe both SSDs clean with DD to be sure

Code: Select all

sudo dd if=/dev/zero of=/dev/sdX bs=512k
3.) Make DOS partition tables for both SSDs with fdisk

Code: Select all

sudo fdisk /dev/sdX
o   create a new empty DOS partition table
w   write table to disk and exit
At this point I restarted computer from USB (again) to make sure that both SSDs are booted as clean from the start (not sure if you really have to do this).

4.) Make partitions using fdisk

Code: Select all

sudo fdisk /dev/sdX
n   add a new partition
w   write table to disk and exit
I made it look like this:
1. 64M for /boot (doubles to 128MB)
2. 20G for /root Linux (doubles to 40GB)
3. 8G for Linux swap (doubles to 16GB)
4. rest for /home (doubles to 63GB)

5.) Give both SSDs boot-flag with fdisk

Code: Select all

sudo fdisk /dev/sdX
a   toggle a bootable flag
w   write table to disk and exit
6.) Change one partition type to Linux swap partition (from 83 to 82) for both SSDs

Code: Select all

sudo fdisk /dev/sdX
t   change a partition type
w   write table to disk and exit
At this point all drives are perfectly set and ready for RAID system installation.

7.) Install mdadm to USB, so you can make actual RAID arrays to SSDs

Code: Select all

sudo apt-get install -y mdadm
8.) Create arrays you want

Code: Select all

sudo mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sda1 /dev/sdb1
sudo mdadm --create /dev/md1 --level=0 --raid-devices=2 /dev/sda2 /dev/sdb2
sudo mdadm --create /dev/md2 --level=0 --raid-devices=2 /dev/sda3 /dev/sdb3
sudo mdadm --create /dev/md3 --level=0 --raid-devices=2 /dev/sda4 /dev/sdb4
9.) Format those new RAID arrays

Code: Select all

mkfs.ext3 /dev/md0			(this is my /boot partition)
mkfs.ext4 /dev/md1			(this is my /root partition, where Linux will be)
mkswap /dev/md2				(this is my swap partition, I made 8G + 8G to get 16GB)
mkfs.ext4 /dev/md3			(this is my /home partition)
10.) Install Mint 18.1 with Ubiquity in a way that it won't install boot loader. Give command in terminal.

Code: Select all

ubiquity -b
Choose Something else and set your system on md's (double click)

Code: Select all

md0 will be "/boot" partiton formated to ext3
md1 will be "/" root partition formated to ext4
md2 will be swap partition (it is already here, no options to choose)
md4 will be /home partition formated to ext4
When installation is ready (and you didn't get any errors), Continue testing. Do NOT boot yet.

11.) Now it is time to install GRUB2, which will help you booting to new system. You can give that list of commands "one after another", but before that I try to explain those.

First you mount your new "SDD/root" to "USB/mnt".
Then you mount your new "SDD/boot" to "USB/mnt/boot".
After that you mount the critical virtual filesystems with mystical single command (for i in...).
And right after that you can change to new root.
Then it is time to install some needed software to new RAID system:
- Install mdadm (on SSD).
- Install GRUB2 to both SSDs (sdA and sdB). This is needed even if you used RAID-1.
- Update GRUB2.

Code: Select all

sudo mount /dev/md1 /mnt
sudo mount /dev/md0 /mnt/boot
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
sudo apt-get install -y mdadm
sudo grub-install /dev/sda
sudo grub-install /dev/sdb
update-grub
12.) After all that, I shutdown my computer and removed USB (just a restart would be probably enough).

Make sure your BIOS is set to boot from correct SSD.

On next start it booted straight away to Mint 18.1! :D

Post Reply

Return to “Newbie Questions”