How to mount a external USB drive automatically

Grzegorz Witkowski geslinux at gmail.com
Thu May 9 20:16:12 UTC 2013


On Wed, May 8, 2013 at 9:53 PM, Anthony <lists at cajuntechie.org> wrote:

> I have an external USB drive that is always connected to my computer.
> When I log in, it shows up on my desktop (unmounted) and all I have to
> do is click on it to mount it. It mounts to
>
> /run/media/anthony/Storage
>
> But I want to have it mount automatically for both me (the system admin)
> and any other users that login to their accounts. I'll then change
> individual folder permissions for access control.
>
> How can I make it mount automatically since it's already showing in its
> unmounted state on my desktop?
>
> Thanks,
> Anthony
> --
> users mailing list
> users at lists.fedoraproject.org
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
> Have a question? Ask away: http://ask.fedoraproject.org
>

Hi Anthony,

1. Mount the drive from your desktop.
2. Check what device was created for the drive. (/var/log/messages, dmesg,
mount, /dev/...)
3. Check the UUID of that device, e.g

(example from my system)
# blkid /dev/sdd1
/dev/sdd1: LABEL="WD10EAVS-EXT4"
UUID="960c3a40-2079-4fff-aebb-85f0337f924a" TYPE="ext4"
# blkid /dev/sdd2
/dev/sdd2: LABEL="WD10EAVS-NTFS" UUID="7EE42C26E42BDF61" TYPE="ntfs"
(I have two partitions on mine)

4. Create a folders for the mount points and make sure they have proper
permissions for the users.
(see http://www.cyberciti.biz/faq/linux-setup-shared-directory/)
5. Modify the /etc/fstab, e.g.

# Manually added
UUID="960c3a40-2079-4fff-aebb-85f0337f924a" /mnt/WD10EAVS-EXT4    ext4
defaults    1 2
UUID="7EE42C26E42BDF61" /mnt/WD10EAVS-NTFS     ntfs    defaults    1 2

6. See man fstab and man mount - if you want to find out more details and
options
7. You could mount them with acl option and use ACLs for more granular
access control.
8. Unmount previously mounted device(s) and run
# mount -a
# mount
to see if the device(s)/partitions will be mounted with no problem from the
/etc/fstab.
9. Check the access to the folder(s).
10. If all above is good reboot the system to test.

You could create a LUKS device or partition first on that external disk to
make it password/key protected, so in case you would lose it no one will be
able to mount it without the password/key.
# man 8 cryptsetup
http://fedoraproject.org/wiki/Implementing_LUKS_Disk_Encryption
https://fedoraproject.org/wiki/Disk_Encryption_User_Guide
https://docs.fedoraproject.org/en-US/Fedora/18/html/Security_Guide/sect-Security_Guide-LUKS_Disk_Encryption.html
https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security_Guide/sect-Security_Guide-LUKS_Disk_Encryption.html

I hope this will help.
All the best.

Kindest regards,
Grzegorz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/users/attachments/20130509/0439a943/attachment.html>


More information about the users mailing list