You are not logged in.

#1 2015-04-02 01:23:55

Disco Dave
Member
Registered: 2014-12-31
Posts: 93

[SOLVED]Problems auto-mounting External HDD via fstab entry

Hello!

I recently set up TimeShift, a backup tool, and I have it set to store the snapshots onto an external HDD. I would like the program to make a snapshot once daily and to do this I would have to mount the external manually.
So I looked up instructions on how to add an external HDD to my fstab. It worked, I got the harddrive to mount at boot, however it then disabled my belkin usb-hub (which has my mouse and keyboard plugged into it). I ran the following commands to add the external to my fstab...

sudo  mkdir /run/media/disco/backup

and then I had to find the path to external by running

mount

found the line I was looking for which was

/dev/sdb1 on /run/media/disco/fcf1f0b0-d756-41d6-a7c8-2ab7d009be2e type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)

So I edited my fstab to the following

   
# 
# 
# /etc/fstab: static file system information
#
# <file system>	<dir>	<type>	<options>	<dump>	<pass>
# /dev/sda1 UUID=a2ba860f-a990-4c75-879b-1138d941857d
/dev/sda1           	/         	ext4      	rw,relatime,data=ordered	0 1

# /dev/sda2 UUID=43fab9a6-904a-4c2e-8362-d2205ef6bbe2
/dev/sda2           	none      	swap      	defaults  	0 0

/dev/sdb1 /run/media/disco/backup auto auto,user,rw,exec 0 0

I reverted back to the fstab that doesn't have the last line, and my belkin usb-hub works again.  I'm just curious if I'm doing something wrong, or if I need additional steps that I am missing.

Any help is appreciated, please and thank you! (:

Last edited by Disco Dave (2015-04-02 02:27:42)

Offline

#2 2015-04-02 02:12:09

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED]Problems auto-mounting External HDD via fstab entry

Have you tried mounting it somewhere else, not in /run?

Offline

#3 2015-04-02 02:27:19

Disco Dave
Member
Registered: 2014-12-31
Posts: 93

Re: [SOLVED]Problems auto-mounting External HDD via fstab entry

karol wrote:

Have you tried mounting it somewhere else, not in /run?

This worked! thank you very much!

Offline

#4 2015-04-02 08:18:17

mr.MikyMaus
Member
From: disabled
Registered: 2006-03-31
Posts: 285

Re: [SOLVED]Problems auto-mounting External HDD via fstab entry

proper directory for persistent mount points is

/mnt/

The /run directory is used by runtime applications as, say, a temporary working directory usually meant to be accessed by other applications as a way of IPC (unlike /tmp which is used as general dump for mostly private volatile data, temporary caches, etc.) The /run directory is usually a tmpfs meaning it only exists in memory and gets deleted on reboot. This is most likely the reason it didn't work for you.

Also, you may want to change the /dev/sdb1 dev node in fstab to a UUID entry so that there is no confusion in case of different block device node gets assigned to the drive (such as if it gets connected after some other storage drive, being it another USB drive, an SD card, or anything else).


What happened to Arch's KISS? systemd sure is stupid but I must have missed the simple part ...

... and who is general Failure and why is he reading my harddisk?

Offline

#5 2015-04-02 08:40:32

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED]Problems auto-mounting External HDD via fstab entry

A couple of things: first, fstab is generally not recommended for handling removable devices, but if this drive is always going to be connected, I guess it will be ok.
Second, and this is of course optional, but you could uses systemd's automount feature to mount the device whenever it is accessed, instead of having it mounted all the time.

Offline

#6 2015-04-08 17:09:20

Disco Dave
Member
Registered: 2014-12-31
Posts: 93

Re: [SOLVED]Problems auto-mounting External HDD via fstab entry

tomk wrote:

Second, and this is of course optional, but you could uses systemd's automount feature to mount the device whenever it is accessed, instead of having it mounted all the time.

This sounds great, and I would like try this systemd's automount since this fstab method is giving me trouble on startup sometimes. I've tried googling systemd automount with not much luck. If you could post a link on systemd's automount, that would be fantastic. Thank you smile

Offline

#7 2015-04-08 17:18:27

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED]Problems auto-mounting External HDD via fstab entry

man systemd.automount

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2015-04-08 17:53:38

Disco Dave
Member
Registered: 2014-12-31
Posts: 93

Re: [SOLVED]Problems auto-mounting External HDD via fstab entry

jasonwryan wrote:
man systemd.automount

So from understanding, I still have to edit the fstab

/dev/sdb1 /mnt/backup ext4 noauto,x-systemd.automount,x-systemd.device-timeout=10,timeo=14,hard,intr,noatime 0 0

Would this be the correct usage? I have scheduled backups that should run at midnight, will this service mount the drive for me then?

Offline

Board footer

Powered by FluxBB