LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-29-2019, 12:22 PM   #1
helen314
Member
 
Registered: Jun 2019
Posts: 78

Rep: Reputation: 0
fstab usage in RAID?


I am still looking for a real solution to be able to mount RAID5 on boot.
Using GParted I have no issues verifying that each individual RAID5 device is mounted on boot.

I have been looking at "fstab" which supposedly "installs" file system on boot to activate / mount "/dev/mdx" devices.

Not really sure if fstab is the correct place to instruct system to mount /dev/mdx .

The header instruction in "fstab" specify the option format, but also states that result of "blkid" is preferred to enter as an "file system" to load.

If "fstab" is the correct place to mount /dev/mdx I have no need to option for mounting individual RAID devices.


The option instructions are not that clear - using "UUID=..." as first entry stops the boot cold.

I am also unable to find where are various labels (PTTYPE , LABEL, PARTUUID etc.) used by "blkid" and copied to "fstab" defined.

Here is a part of NON WORKING fstab file:

Quote:
# added manually for now md124 was md0
# adding mount point does nothing
# does nothiing /dev/md124: PTUUID="6a551d9f" PTTYPE="dos" /dev/md127
# does nothing /dev/md124p1: LABEL="DOC" /media/a/DOC UUID="92f91148-a6dd-4d06-9276-83ba2e39ec07" TYPE="ext4" PARTUUID="6a551d9f-01"
#/dev/md124p2: LABEL="DEV" UUID="506d7ca6-b09c-415b-a681-f7f71ec62513" TYPE="ext4" PARTUUID="6a551d9f-02"
#/dev/md124p3: LABEL="MISC" UUID="922f42e6-6ab1-4cd0-bc82-2aee9868187f" TYPE="ext4" PARTUUID="6a551d9f-03"
#/dev/md124p4: LABEL="BACK" UUID="d2af4a0a-ecaa-48bc-a80c-5dae8b20e5af" TYPE="ext4" PARTUUID="6a551d9f-04"
/dev/md4: PTUUID="5b02aa07-0fd3-4231-bca4-be54d9b91451" PTTYPE="gpt"
/dev/md4p1: LABEL="RAID5_MD4_FULL" /dev/test UUID="29896bf9-3272-4dc4-ba4c-6079418c4ccd" TYPE="ext4" PARTLABEL="RAID5_MD4_FULL" PART$
 
Old 06-29-2019, 04:37 PM   #2
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE, Debian, Knoppix, Mageia, Fedora, others
Posts: 1,762

Rep: Reputation: 541Reputation: 541Reputation: 541Reputation: 541Reputation: 541Reputation: 541
I stopped using /dev/md* syntax in fstab years ago. Instead, I assign a volume label to each RAID device and mount by label, e.g.
Code:
LABEL=raidhome	/home	ext4	noatime	1 2
Fstab remains the correct place for configuring devices to mount at boot. Display existing labels using blkid:
Code:
# lsblk | grep md
/dev/md0: LABEL="raidhome" UUID="blah........" TYPE="ext4"
...
 
1 members found this post helpful.
Old 06-29-2019, 09:29 PM   #3
helen314
Member
 
Registered: Jun 2019
Posts: 78

Original Poster
Rep: Reputation: 0
Well, it sort of works AFTER creating the LABEL using the attached process.
It will not work when using blkid outputs, such as LABEL or TYPE directly.
I think there is a missing relation between device label and mount point fstab keeps complaining about.
I would assume when 'labels' are used it should not make difference WHERE the option is located in the line.
It is hard to prove.


I'll try to add TYPE=ext4 on next try.

Quote:
Get LABEL
# e2label /dev/sdc1

Mount label / link LABEL to mount point (?)
# mkdir -p /media/usb
# mount -L seagate_2tb_usb /media/usb
# df -H

Add to fstab
LABEL=seagate_2tb_usb /media/usb ext3 defaults 0 0
 
Old 06-29-2019, 09:46 PM   #4
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE, Debian, Knoppix, Mageia, Fedora, others
Posts: 1,762

Rep: Reputation: 541Reputation: 541Reputation: 541Reputation: 541Reputation: 541Reputation: 541
In the context of $SUBJECT, I didn't think to consider the possibility of including USB devices in fstab. I've never in recollection included any USB device in a fstab entry. There may be special options necessary to keep those from tangling with udev or autofs, possibly nofail. All my RAID devices are made from internal storage.
 
Old 06-29-2019, 11:33 PM   #5
helen314
Member
 
Registered: Jun 2019
Posts: 78

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by mrmazda View Post
In the context of $SUBJECT, I didn't think to consider the possibility of including USB devices in fstab. I've never in recollection included any USB device in a fstab entry. There may be special options necessary to keep those from tangling with udev or autofs, possibly nofail. All my RAID devices are made from internal storage.
I am glad you brought this up.
I have been struggling with trying to understand Linux boot process for last few weeks and still not sure "who is on first".
The MAIN issue is to keep the forum administrators happy, but one cannot avoid to expand the original post and sometime to make it look as dupe / redundant post.

Second "issue" is - my PC has no plain hard drive "interface" - it is all USB / SATA.
Now USB "operates" on power-up . It sends "I am here" to system BEFORE the system can read the MBR.

In this "mount" case - USB device mounts similar way - it "calls" the OS etc etc.

So how does fstab gets into the act AFTER USB is acknowledged by the system ?
Why do I see the individual RAID devices mounted and have to jump thru hoops to get the "mdx" mounted on boot?
There is something quite not right here. Each RAID physical device is clearly flagged....

I have a feeling that nobody ever run more than ONE "md0" to see how all this mess interacts.
For example one has to run mdadm scan to update mdadm.conf only to find out than now there are dupe entries and things just do not work.
Than the md numbering keeps changing (in GParted) - but fstab keeps the original 0.1.2.3
 
Old 06-30-2019, 12:11 AM   #6
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE, Debian, Knoppix, Mageia, Fedora, others
Posts: 1,762

Rep: Reputation: 541Reputation: 541Reputation: 541Reputation: 541Reputation: 541Reputation: 541
I don't profess to understand any of the magic between kernel, metadata, drivers and whatever else is involved. I use only RAID1, and in /etc/mdadm.conf I have:
Code:
HOMEHOST <ignore>
DEVICE containers partitions
ARRAY /dev/md0 metadata=1.0 name=hostname:root UUID=1...
ARRAY /dev/md1 metadata=1.0 name=hostname:home UUID=2...
ARRAY /dev/md2 metadata=1.0 name=hostname:usrlcl UUID=3...
ARRAY /dev/md3 metadata=1.0 name=hostname:homeav UUID=4...
The magic goes on, and this results:
Code:
# mount | grep -v tem | grep md
/dev/md0 on / type ext4 (rw,noatime,data=ordered)
/dev/md1 on /home type ext4 (rw,noatime,data=ordered)
/dev/md2 on /usr/local type ext4 (rw,noatime,data=ordered)
/dev/md3 on /home/av type ext4 (rw,noatime,data=ordered)
from this fstab:
Code:
LABEL=root	/	ext4	noatime	1 1
LABEL=home	/home	ext4	noatime	1 2
LABEL=usrlcl	/usr/local	ext4	noatime	1 2
LABEL=homeav	/home/av	ext4	noatime	1 2
mdadm.conf needn't be the exact output from a scan. Some learned tweaking is allowable.
 
Old 06-30-2019, 07:48 AM   #7
helen314
Member
 
Registered: Jun 2019
Posts: 78

Original Poster
Rep: Reputation: 0
Short note
I am really puzzled with (Linux) naming conventions.
LABEL versus "label" as used in GParted - are they same ?
Still have not found definitions of "LABEL" or "TYPE".
 
Old 06-30-2019, 10:13 AM   #8
dc.901
Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS 6-7; SuSE 8-12
Posts: 599

Rep: Reputation: 174Reputation: 174
Agree with mrmazda to use LABEL instead.
You could also use UUID.

Only once in my career I tried to use RAID5 on drives installed in USB enclosure. It was a disaster; it was extremely unstable as it crashed frequently. (it was on USB3, and several years ago). May be things have improved?
 
Old 06-30-2019, 11:03 AM   #9
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE, Debian, Knoppix, Mageia, Fedora, others
Posts: 1,762

Rep: Reputation: 541Reputation: 541Reputation: 541Reputation: 541Reputation: 541Reputation: 541
I don't use Gparted, so don't know any of its conventions.

I agree man pages are hopelessly terse for many of us to understand, mostly for lack of examples. The first part of man fstab seems to provide a somewhat reasonable job of leading to an understanding of LABEL.

Code:
# tune2fs -l /dev/md2
tune2fs 1.42.11 (09-Jul-2014)
Filesystem volume name:   usrlcl
...
applies to my comment #6 above.
 
Old 06-30-2019, 12:43 PM   #10
helen314
Member
 
Registered: Jun 2019
Posts: 78

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dc.901 View Post
Agree with mrmazda to use LABEL instead.
You could also use UUID.

Only once in my career I tried to use RAID5 on drives installed in USB enclosure. It was a disaster; it was extremely unstable as it crashed frequently. (it was on USB3, and several years ago). May be things have improved?
I used UUID and my system refused to boot.
It sure looks as replacing /dev and UUID with LABEL was one of these KISS ideas and it is half baked.

The "emergency mode" is not much of a help, I ended up removing the UUID and rebooting.

I wonder if there is away to test "fstab" , this "try and see" is time waster.

I had a have bad experience running USB thru powered external hub. It is "hit and miss".

On good note - I finally got two of the RAID5 partitions mounted on boot.
I'll do some C++ programing for a while, before I clean-up the RAID mess.

Thanks for "holding my hand" - it is very helpful to be able to bounce things off, even when there is no single answer to the issue.
 
Old 06-30-2019, 01:12 PM   #11
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: CentOS, MacOS, [Open]SuSE, Raspian, Red Hat, Slackware, Solaris, Tru64
Posts: 1,503

Rep: Reputation: 167Reputation: 167
[QUOTE=mrmazda;6010396]I stopped using /dev/md* syntax in fstab years ago. Instead, I assign a volume label to each RAID device and mount by label, e.g.
Code:
LABEL=raidhome	/home	ext4	noatime	1 2
This ---^^^^^^^^

I haven't messed with remembering which "md" device should be mounted where for years since I switched to "mount-by-label". Works well with swap partitions as well.
 
Old 06-30-2019, 01:30 PM   #12
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: CentOS, MacOS, [Open]SuSE, Raspian, Red Hat, Slackware, Solaris, Tru64
Posts: 1,503

Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by helen314 View Post
I wonder if there is away to test "fstab" , this "try and see" is time waster.
I hear ya.

There is something of a tradition that UNIX utilities offered a "-n" switch that meant "do what would normally be done but don't actually do it---just show what you would do" ("make -n" comes to mind). So you'd think that "mount -an" would perform a "go through the motions without actually mounting and report on what would normally be mounted". I just had to go through this yesterday when I fat fingered a mount point in fstab and the system kept dumping me into maintenance mode, stupidly clearing the screen and wiping out the error message (thanks guys). I wound up commenting out several of my non-system-related fstab entries and re-adding them one by one before I finally noticed the subtle error (misspelled mount point" "O" vs. "0". Argh!).

Such an fstab-scanning utility shouldn't be too hard to write. The format of the file is pretty well defined. (One more thing for the Rainy Day Job Jar.)
 
Old 06-30-2019, 01:53 PM   #13
helen314
Member
 
Registered: Jun 2019
Posts: 78

Original Poster
Rep: Reputation: 0
[QUOTE=rnturn;6010616]
Quote:
Originally Posted by mrmazda View Post
I stopped using /dev/md* syntax in fstab years ago. Instead, I assign a volume label to each RAID device and mount by label, e.g.
Code:
LABEL=raidhome	/home	ext4	noatime	1 2
This ---^^^^^^^^

I haven't messed with remembering which "md" device should be mounted where for years since I switched to "mount-by-label". Works well with swap partitions as well.
Yes, "volume label" misnamed "(partition) Name " is manually assigned in GParted "mdx" partition during manual (partition) buid, with "raid" flag to boot.
The automatic "mount this" and put it in "fstab" process is just missing.
 
Old 06-30-2019, 11:15 PM   #14
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE, Debian, Knoppix, Mageia, Fedora, others
Posts: 1,762

Rep: Reputation: 541Reputation: 541Reputation: 541Reputation: 541Reputation: 541Reputation: 541
Quote:
Originally Posted by helen314 View Post
I wonder if there is away to test "fstab" , this "try and see" is time waster.
It's more or less right there in man fstab:
Code:
mount -fav
 
Old 07-01-2019, 09:37 AM   #15
helen314
Member
 
Registered: Jun 2019
Posts: 78

Original Poster
Rep: Reputation: 0
Nice, but...
I just changed BACK_COPY_LABEL fstab entry from "defaults" to "default" and this
what I got.

So it really does not verify "fstab" - just reads current mount state. Which is better than having to do the "reboot" dance.


I have also "discovered" that "Gparted" lets assign REAL "LABEL", no need to use the "process" I posted before.
It still does not have (visible(?)) means to "mount" any partition.
But does some nice manipulation of RAID array itself - resize RAID partition etc.



Quote:
z@z-desktop:~$ sudo mount -fav
/ : ignored
/boot/efi : already mounted
none : ignored
/media/z/DOC_COPY_LABEL : already mounted
/media/z/DEV_COPY_LABEL : already mounted
/media/z/MISC_COPY_LABEL : already mounted
/media/z/BACK_COPY_LABEL : already mounted
z@z-desktop:~$
 
  


Reply

Tags
fstab


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Configuring / Usage of RAID 0 & RAID 5 with PV / VG / LVM John King Linux - Server 9 08-17-2012 10:00 PM
which raid level (RAID 5 or RAID 10) inspiredbymetal Linux - Server 4 11-25-2007 07:59 PM
HW RAID, fake-HW RAID or SW RAID? stromdal Linux - Hardware 5 08-10-2007 02:54 AM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration