Making mounting of drive persistant.

I have my multimedia files on a new RAID array and wish to make the mounting persistent when I re-boot. I understand that the way to do this is by editing /etc/fstab. I have the the id of the partition but there are several fields in the line for each mount point on which I am not sure.

The existing fstab is as follows:-

/dev/disk/by-id/scsi-SServeRA_Drive_1_6CFF75A5-part6 swap                 swap       defaults              0 0
/dev/disk/by-id/scsi-SServeRA_Drive_1_6CFF75A5-part1 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/scsi-SServeRA_Drive_1_6CFF75A5-part5 /home                ext4       acl,user_xattr        1 2
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

I think I need to add after line for /home:-

/dev/disk/by-id/scsi-SServeRA_Drive_2_4BB0A82C-part1 /home/me/mastermedia  ext4  acl,user_xattr  1 2

After /home because mastermedia is in my /home/me tree but are the last two fields correct; the 1 for dumping and 2 for fs passno?

Grateful for any advice particularly on if I am going about this the right way and is what I propose correct?

Budgie2

How do you come to that conclusion?

Following your /etc/fstab, your /home should already be mounted on startup.

Or do you have a further physical partition linked in as a sub-tree of /home that isn’t yet represented by an entry in your /etc/fstab ?

Otherwise a possibility could be that the booting of your system takes place faster than the spin-up of the hdd’s of your RAID,
so that the RAID may not be ready yet.

Just an idea, because

you well seem to be able to mount everything.

Or do you have the new RAID plugged in addition to an existing hard disk?

You’re not that clearly stated.

It would probably help if you could post the output of

parted -l

that you get in a root terminal after all drives are mounted.

(edit: added ‘of’)

On Mon, 25 Feb 2013 23:46:01 +0000, Budgie2 wrote:

> Grateful for any advice particularly on if I am going about this the
> right way and is what I propose correct?

Other issues aside, you might try setting it up using YaST rather than by
manually editing the fstab file - that should help ensure that you get
the right options set.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Not only is YaST the preferred tool to manage an openSUSE system that should be tried first before you go for other more manual methods, YaST, in this case, also offers very clear the possibility to mount e.g. by-id.

Hi, sorry I didn’t make it clear. I have added a new raid array which I am intending to link into the existing tree. This should make it clear:-

Model: ServeRA Drive 1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  21.5GB  21.5GB  primary   ext4            type=83
 2      21.5GB  45.1GB  23.6GB  primary   ext4            boot, type=83
 3      45.1GB  70.9GB  25.8GB  primary   ext4            type=83
 4      70.9GB  1000GB  929GB   extended                  lba, type=0f
 5      70.9GB  996GB   926GB   logical   ext4            type=83
 6      996GB   1000GB  3470MB  logical   linux-swap(v1)  type=82


Model: ServeRA Drive 2 (scsi)
Disk /dev/sdb: 3000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt_sync_mbr

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  3000GB  3000GB  ext4         primary

Jim, many thanks. I would do this if I knew how. The array already has valuable data on it and I do not want to lose it. The only tool I know of is the Yast partitioner. Can I use this to mount without reformatting or risking the data?

Meanwhile is my proposed fstab edit correct?

OK but which tool do I use please. The array is already partitioned and has data on it. Is there a guide anywhere please?

On 2013-02-27 00:26, Budgie2 wrote:
> Meanwhile is my proposed fstab edit correct?

I think it is, but I don’t know if the raid array identifier is correct.
I use labels myself.

Editing fstab and mounting partitions is really easy. Just make sure
that it mounts correctly and do not reboot until it is: an incorrect
fstab blocks boot.

Make a backup copy of the file, edit it, try the mount. The mount
command will tell you the errors if there are. If you can not get it,
comment the offending line out.

I would use a 3 for the passno, perhaps.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

On Tue, 26 Feb 2013 23:26:02 +0000, Budgie2 wrote:

> hcvv;2530147 Wrote:
>> Not only is YaST the preferred tool to manage an openSUSE system that
>> should be tried first before you go for other more manual methods,
>> YaST,
>> in this case, also offers very clear the possibility to mount e.g.
>> by-id.
>
> OK but which tool do I use please. The array is already partitioned and
> has data on it. Is there a guide anywhere please?

YaST partitioner. Just don’t delete or change the partition structure.

Expand the disk out and select the RAID array and click “Edit”. Under
“mounting options” you can set where it’s mounted and set the mounting
options.

Make sure you DO NOT change the formatting options or the encryption
option. If you get any warning messages at all that indicate data will
be destroyed/the device will be formatted, abort without saving the
changes.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

To edit /etc/fstab always is a bit risky, because typing errors are always possible.

You could as well use ‘parted’ from a terminal/shell (command line), but here again, there is the risk of typing errors,
which in case of the partitioning of a hard disk can have severe consequences.

You can very well use the partitioner in YaST (I deem this one uses ‘parted’ in the background) without risking to reformat any partition/drive,
because you will explicitly have to tell it to do so (i.e. to format or delete).

Although only a click away, formatting or deleting of partitions only will take place when you agree.
There are no miracles here.
Just be aware of what you’re doing - so do it when you have slept well and you’re awake.

Good luck
Mike

Hi and thanks all for the advice. I understand the advice and will try with caution. My RAID is in hardware so drive shows just as /dev/sdb1 and doesn’t show in RAID section of Yast. I have it mounted temporarily using mount command so it shows as mounted in YAST but even if I edit and OK etc. no change is made to /etc/fstab. Will unmount and try again and report back in due course.
Thanks again,
Budgie

Hi and thanks for the help. After all the advice to use Yast I worked out how to do it and all seems well. My proposed edit line of /etc/fstab was exactly correct but Yast added it at the end of the file. The passno is 2 BTW.

Thanks again,
Budgie2

On 2013-02-28 01:06, Budgie2 wrote:
> The passno is 2 BTW.

You can put the number you like. I’d use 3 because I use 1 for the root
filesystem, 2 for the rest of partitions, and 3 for those partitions
mounted under other partitions, etc.


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))

On 2013-02-28 00:06, ratzi wrote:
> To edit /etc/fstab always is a bit risky, because typing errors are
> always possible.

The risk is if you reboot before testing that it is right :slight_smile:
Otherwise, pure routine.


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))