Mounting a USB Key Without Using the Root Account Each Time
- If you already have files on the USB key, please back them up before hand. You never know what might happen.
- To mount the USB key you need to find out which drive it will be loaded as. Normally, this is /dev/sda1. To make sure, log in with the root account and create the folder /mnt/usbkey; and then type the following command:
- >mount -tvfat -uomask=0000 /dev/sda1 /mnt/usbkey
- If it does not mount the usb key, use sdb1 and so on until you find the correct drive assignment.
- Now, edit /etc/fstab using vi and add the following line at the bottom:
- /dev/sda1 /mnt/usbstick vfat user,rw,noauto,umask=0 0 0
- Note: Make sure to use the correct drive letter assignment.
- Now, once you login with your normal user account you’ll be able to mount and unmount the usb key without having to be logged in with the root account.
- mount /mnt/usbkey
- umount /mnt/usbkey