Ask Your Question
0

How to Mount a 2nd Hard drive automatically

asked 2015-03-17 12:19:51 -0500

Orriginal gravatar image

updated 2015-04-12 00:00:07 -0500

mether gravatar image

Ihave loked through this site but cannot find the answer I need..SO - In my PC, I boot Fedora 21 off a Scsi drive but I hold all the data on a 2nd drive. Once I have logged in and want to access this data I have to enter the root Password to gain access to the disk.

How can I mount this drive automatically and have it NOT ask for the password. I assume I need to edit the fstab file.the drive is listed as sda1.and is listed by lsblk as having an EXT4 filesystem

Simply put I do not want to give out my Root password just so other members of the house can access their own data LOL..Its been a nightmare so far.. HELP

edit retag flag offensive close merge delete

Comments

I understand this maybe a beginners question......but I am one ;-)

Orriginal gravatar imageOrriginal ( 2015-03-17 12:33:35 -0500 )edit

4 Answers

Sort by ยป oldest newest most voted
4

answered 2015-03-17 13:07:21 -0500

So, this is a question you should be able to answer for yourself with the fstab and mount manual pages. I encourage you to at least look those documents over and come to a thorough understanding of what you're doing here.

As for the process, it is simple, and you are correct about editing the fstab file. The entry you need to make will look something like:

/dev/sda1 /mount/point ext4 defaults 1 1

To test your mount configuration, place the proper information into /etc/fstab, save the file, and then unmount the file system on the disk. To remount it, if your /etc/fstab configuration is done correctly, you should only have to type mount /mount/point with the proper privileges (sudo or root).

Double-check that your external drive is actually /dev/sda - that's almost always the drive from which you're booting Fedora, so given your description of your system, I'd expect your external disk to be /dev/sdb.

edit flag offensive delete link more

Comments

Thank yo very much..and yes..you are right. I shall read the MAN pages..

Orriginal gravatar imageOrriginal ( 2015-03-18 06:15:39 -0500 )edit

Hey bitwiseoperator, I've first read the man pages for fstab but did not understand the specs described there. It's not clear at all. I've also think everybody should try to make thing by themselves but sometimes it's not easy. Thank you for your answer.

damonh gravatar imagedamonh ( 2015-12-21 16:00:57 -0500 )edit

All is good, but in Fedora 25, in 2017, we should have a "mount on boot" button. I am certain the CIA won't get into Putin's Misile plans if my backup disk mounts on boot. I am sure this feature made sense in a lab, a long time ago, but now us having to edit text files so we can skip 5 clicks and a password every time we restart our computer makes no sense what so ever. I got tired of Windows about, I don't know, five years ago, maybe more, so I installed Fedora and never looked back. I have never read a man page nor do I plan to. I have no interest in the inner workings of file systems.

Lazaro Kohen gravatar imageLazaro Kohen ( 2016-12-12 20:32:27 -0500 )edit

Lazaro - Fedora's udev subsystem does mount detachable media on boot (or whenever it's connected, in fact), so I'm not sure what problem you're having that you're not seeing a resolution for. Maybe ask a separate question with more details about your situation? I'm sure we can find a working solution for you.

bitwiseoperator gravatar imagebitwiseoperator ( 2016-12-17 09:06:32 -0500 )edit
3

answered 2015-03-17 12:58:57 -0500

aeperezt gravatar image

You need to add a line on your fstab file so your system can mount this partition at boot time.

To do so add something like :

/dev/sdb1 /mnt/drive ext4 defaults 0 0

Where /dev/sdb1 should be your drive, /mnt/drive is your mount point, ext4 your partition type, defaults should be your options and 0 0 are order to check.

More information here http://en.wikipedia.org/wiki/Fstab

You can also use UUID of your drive

First you find your UUID like this:

lsblk --output UUID,NAME

then your edit /etc/fstab and add

UUID=drive-UUID mountppoint type defautls order

as on the first example.

Before rebooting your computer test your mount with:

mount -a

Hope this help

edit flag offensive delete link more

Comments

One important thing: the mount command expects every line, even the last, to be properly terminated. Be sure that you hit Enter at the end of the line, or you'll get an error message when you use mount -a.

sideburns gravatar imagesideburns ( 2015-03-17 14:59:53 -0500 )edit

Thank you ;-)

Orriginal gravatar imageOrriginal ( 2015-03-18 06:10:19 -0500 )edit

I was under the impression that the whole thing about using "vi" as an edittor is that it will AVOID doing a carriage return I thought that was to ne avoided 100%

Orriginal gravatar imageOrriginal ( 2015-03-18 12:29:55 -0500 )edit

I have no idea where you got that impression. There are numerous places where having a line properly ended is important. There are many, many things I can accuse vi of, but not that.

sideburns gravatar imagesideburns ( 2015-03-18 19:36:58 -0500 )edit
1

answered 2018-03-30 07:17:05 -0500

cip_fedora gravatar image

updated 2018-03-30 07:17:34 -0500

To do this by a GUI.

Install Disks (package to install: gnome-disk-utility;command to run: gnome-disks).

There you can select each partition and edit its startup mount point. Images and details HERE.

edit flag offensive delete link more
0

answered 2015-12-21 16:05:40 -0500

I added one extra HDD to fstab to make it available from startup. Following this answers I added this line to /etc/fstab:

/dev/sda2 /run/media/my_username/Data ntfs defaults 1 2

being 'Data' the tag of the hard disk partition

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-03-17 12:19:51 -0500

Seen: 28,470 times

Last updated: Mar 30