mdadm for jbod or raid-0

Essence_of_War

Platinum Member
Feb 21, 2013
2,650
4
81
I'm messing around with a dell optiplex 3020 that will be doing some fortran simulations. I've added a 2nd hard drive, and I'd like to either span w/ JBOD, or RAID-0 the 2nd hard drive with a large chunk of the first hard drive so that it presents to ubuntu as a single, large, logical volume for storing simulation data dumps, can be backed up easily before/during/after simulations, and can be mounted on boot w/o any user input.

Here's what the partition tables currently look like:

Device Boot Start End Blocks Id System
/dev/sda1 63 80324 40131 de Dell Utility
Partition 1 does not start on physical sector boundary.
/dev/sda2 * 81920 21467135 10692608 7 HPFS/NTFS/exFAT
/dev/sda3 21467136 328667135 153600000 7 HPFS/NTFS/exFAT
/dev/sda4 328667136 1953523711 812428288 5 Extended
/dev/sda5 328669184 451549183 61440000 83 Linux
/dev/sda6 451551232 482271231 15360000 82 Linux swap / Solaris
/dev/sda7 482273280 1953523711 735625216 83 Linux

Device Boot Start End Blocks Id System
/dev/sdb1 63 1465149167 732574552+ 83 Linux

Basically, /sda is the stock hard drive it came with, that includes in order:
a dell utility partition (sda1)
a recovery partition for the pre-installed Win7 Pro (sda2)
the current windows installation (sda3),
an extended partition (sda4) that includes:
Ubuntu 14.04 (sda5),
swap (sda6)
and an empty ext4 filesystem (sda7).

/sdb is an older hard drive with nothing of value with just an ext4 filesystem. /sdb is the same size as /sda7.

My thinking was using mdadm to raid-0 /sda7 w/ /sdb, something like this:
mdadm --create /dev/md0 --chunk=64 --level=raid0 --raid-devices=2 /dev/sda7 /dev/sdb1

Is it OK to raid-0 a logical partition of an extended partition with a primary partition on another physical device? I don't really care if the performance isn't going to be as good using two identical, modern drives. Are there any other gotchas I might run into?

Before doing any of this, original dell machine was imaged, and I've imaged it again after setting up Ubuntu. There is no data of any value on any of the hard drives/partitions etc, that has not already been backed-up.

Edit:
Added a sample command
 
Last edited:

Essence_of_War

Platinum Member
Feb 21, 2013
2,650
4
81
So I ended up just doing it :p

Basically:
sudo mdadm --create --verbose /dev/md0 --level=0 --raid-device=2 /dev/sda7 /dev/sdb1

I tried to pipe the config to the config file:
sudo mdadm --detail --scan --verbose > /etc/mdadm/mdadm.conf

but for some reason that kept giving an error. It would return:
"bash: /etc/mdadm/mdadm.conf: Permission Denied"
which seemed odd because I was running with sudo and it didn't even ask me for my credentials. Did I need a sudo on the other side of the pipe also?

So I just ran it, copied, the output, and appended it manually.

Built an FS on top:
sudo mkfs.ext4 /dev/md0

Made a mount point:
sudo mkdir /media/raid0_data

Edit'd fstab to add:
/dev/md0 /media/raid0_data/ ext4 defaults 1 2

And then mounted to simulate a boot:
sudo mount -a

and checked that everything was mounted correctly:
mount

And everything looks good so far. Let me know if I did anything dumb!