possible to automount a software btrfs raid 5 at start?

Quick to answer questions about finding your way around Linux Mint as a new user.
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. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
jzilla50

possible to automount a software btrfs raid 5 at start?

Post by jzilla50 »

Mint MATE 17Q on an SSD.
I made a btrfs raid 5 with 3 TB HDDs and everything was fine but then I realized that I always have to start the raid in the "control"/disk menu.

I tried to set it up manually in the /etc/fstab but it seems I have not enough experience because I endet up with a system in read only mode. And I don't understand some points in the DISK menu when I try to put it on autoconfiguration I will have a ro system as well. (I guess the menu and I will not be friends :)

I have no idea besides I have made some progress but there are blind spots because I use Mint for only 6 months now.

If there is a way let me now.

I know the btrfs sw raid is stupid but I'm testing it as iSCSI and Storage Cube.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
WharfRat

Re: possible to automount a software btrfs raid 5 at start?

Post by WharfRat »

jzilla50,

Can you

Code: Select all

ls -l /dev/mapper
with the raid active
Mute Ant

Re: possible to automount a software btrfs raid 5 at start?

Post by Mute Ant »

I have been running a BTRFS pair of old 80GB drives as my Rebecca [booting] system for two weeks now. You just mount 1 of the component partitions where you want it, the kernel seems to take care of finding and attaching the other components [no mapper as far as I can tell]. From the entry in /etc/fstab you can't tell it's RAID data, multiple device or anything special...
  • /dev/sda1 / btrfs compress,autodefrag,noatime 0 0
...but I see 160GB system space.

Rebeca kernel version is 3.13.0-37-generic
Rebecca btrfs version is 3.12
Rebecca grub-pc version is 2.02~beta2-9ubuntu1
jzilla50

Re: possible to automount a software btrfs raid 5 at start?

Post by jzilla50 »

Hi WharfRat,

yes I did and I got this.

insgesamt 0
crw------- 1 root root 10, 236 Nov 27 22:09 control

:/ But it is working???
WharfRat wrote:jzilla50,

Can you

Code: Select all

ls -l /dev/mapper
with the raid active
jzilla50

Re: possible to automount a software btrfs raid 5 at start?

Post by jzilla50 »

Hi Mute Ant,

aha I may not use /dev/md127 is that right? I always tried to use the name choosen by the system.

When I choose the first disk physical drive of the raid it should work do you think?

Don't want to kill this btrfs raid yet :)


Mute Ant wrote:I have been running a BTRFS pair of old 80GB drives as my Rebecca [booting] system for two weeks now. You just mount 1 of the component partitions where you want it, the kernel seems to take care of finding and attaching the other components [no mapper as far as I can tell]. From the entry in /etc/fstab you can't tell it's RAID data, multiple device or anything special...
  • /dev/sda1 / btrfs compress,autodefrag,noatime 0 0
...but I see 160GB system space.

Rebeca kernel version is 3.13.0-37-generic
Rebecca btrfs version is 3.12
Rebecca grub-pc version is 2.02~beta2-9ubuntu1
Mute Ant

Re: possible to automount a software btrfs raid 5 at start?

Post by Mute Ant »

If you have /dev/md127 I have no idea how it will behave, sorry.
mintybits

Re: possible to automount a software btrfs raid 5 at start?

Post by mintybits »

A raid usually needs an ARRAY statement in /etc/madam/madam.conf

It also needs a mount point defined in /etc/fstab. The mount point has to exist. For example something like this

Code: Select all

/dev/md127    /media/raid  btrfs  defaults   0 2

You can call the array what you like in the ARRAY statement, eg: /dev/md1 so long as it is matched in fstab.

I think you can make an array statement using: sudo mdadm -Es

Please post the output of

Code: Select all

cat /proc/mdstat
jzilla50

Re: possible to automount a software btrfs raid 5 at start?

Post by jzilla50 »

Hi and thank you for your kind answers. This really helps to close some blind spots :)

mdadm.conf:
ARRAY /dev/md127 UUID=8d20etc

sudo mdadm -Es gives me:
ARRAY /dev/md/MyRAID5 metadata=1.2 UUID=8d20etc name=mypc:MyRAID5

cat /proc/mdstat
Personalitiers : [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid1] [raid10]

md127 : active raid5 sdd[3] sdc[1] sdb[0]
5860270080 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]
bitmap: 0/22 pages [0KB], 65536KB chunk

unused devices: <none>


Mhrm...

ARRAY /dev/md/MyRAID5 and /dev/md127? Is this a bug or a feature?


mintybits wrote:A raid usually needs an ARRAY statement in /etc/madam/madam.conf

It also needs a mount point defined in /etc/fstab. The mount point has to exist. For example something like this

Code: Select all

/dev/md127    /media/raid  btrfs  defaults   0 2

You can call the array what you like in the ARRAY statement, eg: /dev/md1 so long as it is matched in fstab.

I think you can make an array statement using: sudo mdadm -Es

Please post the output of

Code: Select all

cat /proc/mdstat
jzilla50

Re: possible to automount a software btrfs raid 5 at start?

Post by jzilla50 »

Hej no problem I'm still learning :) and it is fun.
Mute Ant wrote:If you have /dev/md127 I have no idea how it will behave, sorry.
mintybits

Re: possible to automount a software btrfs raid 5 at start?

Post by mintybits »

jzilla50 wrote: Mhrm...

ARRAY /dev/md/MyRAID5 and /dev/md127? Is this a bug or a feature?
One person's bug is another person's feature. :wink:

The array device name in mdadm.conf needs to match the one in fstab.
WharfRat

Re: possible to automount a software btrfs raid 5 at start?

Post by WharfRat »

jzilla50,

Maybe btrfs raid is handled differently, but when running a lvm or linux software raid the mapper shows the abstract devices. This is an lvm setup

Code: Select all

bill@4700 ~ $ ls -l /dev/mapper/
total 0
crw------- 1 root root 10, 236 2014-11-29 09:34:35 control
lrwxrwxrwx 1 root root       7 2014-11-29 09:34:38 vg0-home -> ../dm-1
lrwxrwxrwx 1 root root       7 2014-11-29 09:34:38 vg0-root -> ../dm-0
lrwxrwxrwx 1 root root       7 2014-11-29 09:34:38 vg0-shared -> ../dm-3
lrwxrwxrwx 1 root root       7 2014-11-29 09:34:38 vg0-swap -> ../dm-2
so the fstab entries will match the links

Code: Select all

/dev/mapper/vg0-root /               ext3    noatime,errors=remount-ro 0       1
/dev/mapper/vg0-home /home           ext3    defaults,noatime,errors=remount-ro        0       2
/dev/mapper/vg0-swap none            swap    sw              0       0
/dev/mapper/vg0-shared	/media/shared	ext3	defaults,errors=remount-ro,noatime	0	2
Since yours didn't show anything, I'll have to assume that btrfs raid differs from the usual mapping mechanisms :?
Locked

Return to “Beginner Questions”