[PLUG] RAID0 via GParted

TomasK tomas.kuchta.lists at gmail.com
Wed Nov 4 22:05:40 UTC 2020


On Wed, 2020-11-04 at 13:39 -0800, Paul Heinlein wrote:
> On Wed, 4 Nov 2020, Russell Senior wrote:
> 
> I think that the following is what I need to create the RAID:
>
> sudo mdadm --verbose --create /dev/md1 --level=0 --raid-devices=4
> /dev/nvme1 /dev/nvme2 /dev/nvme3 /dev/nvme4
>

Since you removed the partitions - what you listed is the correct
usage.
Then you create partition/format /dev/md1 - gparted should see it.
Followed by normal mount.

> > My nvme foo is weak, but I think your partition on an nvme is going
> > to
> > look like /dev/nvme1n1p1 or something. I just checked one of my
> > machines and confirmed that naming.
> > 
> > so, modify your mdadm command to use /dev/nvme1n1p1 /dev/nvme2n1p1
> > /dev/nvme3n1p1 /dev/nvme4n1p1 at the end.
> > 
> > 
> > On Wed, Nov 4, 2020 at 1:04 PM John Jason Jordan <johnxj at gmx.com>
> > wrote:
> > > 
> > > On Tue, 03 Nov 2020 16:51:38 -0800
> > > TomasK <tomas.kuchta.lists at gmail.com> dijo:
> > > 
> > > > Correct - you need to setup ordinary SW raid - follow mdadm
> > > > documentations.
> > > > 
> > > > https://www.educba.com/what-is-raid-in-linux/
> > > > https://raid.wiki.kernel.org/index.php/RAID_setup
> > > > in this order ....
> > > 
> > > OK, software RAID is what I need. That eliminates the problems
> > > you
> > > discussed, plus I can't figure out how to use whatever RAID
> > > features
> > > exist on the PCIe cards that the U.2 drives are physically
> > > mounted on,
> > > so to heck with them.
> > > 
> > > My first problem was that mdadm was not installed. This computer
> > > has
> > > Xubuntu 20.04.1, so that surprised me. But no trouble, apt was
> > > happy to
> > > install it.
> 
> I will ever so humbly and politely throw my wrench in here...
> 
> Have you considered using ZFS rather than mdadm+xfs/ext? Ubuntu
> 20.04 
> has native packages. I find it easier to maintain than a mdadm
> device, 
> plus you get compression (if you'd like) and checksumming for free.
> 
> You can easily create setups akin to RAID1, RAID5, RAID6, or RAID10. 
> E.g., for RAID10
> 
> # install the package
> apt install zfsutils-linux
> 
> # create a pool named 'myarchive' with a mirrored device
> zpool create myarchive mirror nvme1 nvme2
> 
> # add a second mirrored to device to 'myarchive'
> zpool add myarchive mirror nvme3 nvme4
> 
> # create a zfs filesystem in the the 'myarchive' pool,
> # mounting it as /data and enabling default compression
> zfs create \
>    -o compression=on \
>    -o mountpoint=/data \
>    myarchive/data
> 
> 
> 
> Anyway, that's my troublemaking for the day...
> 
> 

This would be good time/place to mention GPL compatible btrfs -
avoiding traditional mdadm:

# Create a filesystem across four drives (metadata mirrored, linear
data allocation)
mkfs.btrfs -d single /dev/nvme1 /dev/nvme2 /dev/nvme3 /dev/nvme4

# Stripe the data without mirroring, metadata are mirrored
mkfs.btrfs -d raid0 /dev/nvme1 /dev/nvme2 /dev/nvme3 /dev/nvme4

# mount it referring to any of your nvme
mount /dev/nvme4 /mnt

Advantages over other setup (including zfs): you can both add and
remove device from the pool.

# add device to the pool:
btrfs device add /dev/sdc /mnt
# if it is raid and not JBOD (single) pool - to balance the stripes
# btrfs filesystem balance /mnt

# remove device from the pool
btrfs device delete /dev/sdc /mnt

+ compression, ....... at mount or per file/directory by chattr

Just saying - no intention to make this post-election time any harder.

Tomas




More information about the PLUG mailing list