Difference between revisions of "How To Use USB Drives"

From Amahi Wiki
Jump to: navigation, search
m (Bigfoot65 moved page HowTo use USB disks to How To Use USB Drives: Standardized naming.)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
+
{{NeedsUpdate}}
== Use USB Disks or sticks ==
+
== Use USB Disks or Sticks on Fedora ==
  
 
[[Category:Help]]
 
[[Category:Help]]
Line 8: Line 8:
 
   
 
   
 
Install autofs
 
Install autofs
{{Code|Code= yum install autofs}}
+
yum install autofs
  
 
Need VFAT for the big USB Disk or the large files on it:
 
Need VFAT for the big USB Disk or the large files on it:
  
{{Code|Code= ​yum install fuse fuse-ntfs-3g}}
+
​yum install fuse fuse-ntfs-3g
  
 
Setup the autofs by edit master settings
 
Setup the autofs by edit master settings
Line 20: Line 20:
 
Add one (or more) line for the USB disk /var/hda/vol /etc/auto.vol  --timeout=3
 
Add one (or more) line for the USB disk /var/hda/vol /etc/auto.vol  --timeout=3
  
{{Code|Code= nano /etc/auto.master}}
+
nano /etc/auto.master
 
<pre>
 
<pre>
 
# Sample auto.master file
 
# Sample auto.master file
Line 50: Line 50:
 
Add the directory by
 
Add the directory by
  
{{Code|Code= ​mkdir /var/hda/vol ; chmod 775 /var/hd}}
+
​mkdir /var/hda/vol ; chmod 775 /var/vol
  
 
 
Then add the auto.vol file:
+
Then add, '''with appropriate changes to your partitions''' the auto.vol file:
  
{{Code|Code= ​nano /etc/auto.vol}}
+
​nano /etc/auto.vol
 
<pre>
 
<pre>
 
#
 
#
Line 62: Line 62:
 
# mountpoint_key options location_device # man 5 autofs
 
# mountpoint_key options location_device # man 5 autofs
 
#
 
#
cdrom  -fstype=auto,ro,nosuid,nodev,user                      :/dev/cdrom
+
cdrom  -fstype=auto,ro,nosuid,nodev,user                      :/dev/cdrom   # the cd rom
 
#floppy -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/fd0
 
#floppy -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/fd0
 
K      -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/sdk1
 
K      -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/sdk1
 
K.2    -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000  :dev/sdk2 #2nd partition
 
K.2    -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000  :dev/sdk2 #2nd partition
 
K.3    -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000  :dev/sdk3 #3d partition
 
K.3    -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000  :dev/sdk3 #3d partition
L      -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/sdl1
+
L      -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/sdl1 # some other drive
M      -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/sdm1
 
N      -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/sdn1
 
O      -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/sdo1
 
G      -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/sdg
 
H      -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/sdh
 
I      -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/sdi
 
J      -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/sdj
 
 
</pre>
 
</pre>
  
Now restart autofs and then all is GO
+
Make browse active by edit the file autofs  
  
{{Code|Code= ​service autofs restart}}
+
​nano /etc/sysconfig/autofs
  
Create the symlinks
+
Change line BROWSE_MODE="no" to BROWSE_MODE="yes"
  
{{Code|Code= ​ln -s /var/hda/vol /var/hda/files/Disks}}
+
Now restart and permanently enable autofs and then all should be good to go:
  
Make browse active by edit the file autofs  
+
systemctl restart autofs
 +
systemctl enable autofs
  
{{Code|Code= ​nano /etc/sysconfig/autofs}}
+
Create a share and add symlinks from it to the newly set up drive
  
Change line BROWSE_MODE="no" to BROWSE_MODE="yes"
+
​ln -s /var/hda/vol /var/hda/files/Disks
  
 
 
That is all, but for more see:
 
That is all, but for more see:
 
http://www.autofs.org/autofs-man.html
 
http://www.autofs.org/autofs-man.html
  
[[User:Nalleju|Nalleju]]
+
== Use USB Disks or Sticks on Ubuntu Server ==
 +
 
 +
Ubuntu Server edition doesn't have the same automount function as the desktop version, so if you want to add the functionality here's how:
 +
 
 +
Install the usbmount package
 +
 
 +
sudo apt-get install usbmount
 +
 
 +
This will install the daemon and create some empty mount points at /media/usb0-7
 +
 
 +
If you now plug in a USB drive, it will be automounted in the first empty folder i.e. /media/usb0
 +
 
 +
If you need to mount an NTFS drive, then you need to edit the config file:
 +
 
 +
sudo nano /etc/usbmount/usbmount.conf
 +
<pre>
 +
# Filesystem types: removable storage devices are only mounted if they
 +
# contain a filesystem type which is in this list.
 +
FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus ntfs"
 +
</pre>
 +
 
 +
Find the 'FILESYSTEMS' entry and add 'ntfs' at the end
 +
 
 +
If you use USB drives regularly you might want to add a symlink under /var/hda/files for one or more of the mountpoints, for example:
 +
 
 +
ln -s /media/usb0 /var/hda/files/drives/usb
 +
 
 +
That's it!

Latest revision as of 01:21, 16 September 2015

Msgbox.update.png Update Needed
The contents of this page have become outdated or irrelevant. Please consider updating it.

Use USB Disks or Sticks on Fedora

I have several USB and eSATA disk I need on my machine. I also need to bring files and take files from the machine by USB stick. I use Putty and Webmin for these things

Install autofs

yum install autofs

Need VFAT for the big USB Disk or the large files on it:

​yum install fuse fuse-ntfs-3g

Setup the autofs by edit master settings

Change 2 lines to (if not needed)

Add one (or more) line for the USB disk /var/hda/vol /etc/auto.vol --timeout=3

nano /etc/auto.master
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#
/var/hda/vol    /etc/auto.vol  --timeout=3
#
#/misc  /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
#      "nosuid" and "nodev" options unless the "suid" and "dev"
#      options are explicitly given.
#
#/net  -hosts
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master

Add the directory by

​mkdir /var/hda/vol ; chmod 775 /var/vol


Then add, with appropriate changes to your partitions the auto.vol file:

​nano /etc/auto.vol
#
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# mountpoint_key options location_device # man 5 autofs
#
cdrom  -fstype=auto,ro,nosuid,nodev,user                      :/dev/cdrom    # the cd rom
#floppy -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/fd0
K      -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/sdk1
K.2    -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000  :dev/sdk2 #2nd partition
K.3    -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000  :dev/sdk3 #3d partition
L      -fstype=auto,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/sdl1 # some other drive

Make browse active by edit the file autofs

​nano /etc/sysconfig/autofs

Change line BROWSE_MODE="no" to BROWSE_MODE="yes"

Now restart and permanently enable autofs and then all should be good to go:

systemctl restart autofs
systemctl enable autofs

Create a share and add symlinks from it to the newly set up drive

​ln -s /var/hda/vol /var/hda/files/Disks

That is all, but for more see: http://www.autofs.org/autofs-man.html

Use USB Disks or Sticks on Ubuntu Server

Ubuntu Server edition doesn't have the same automount function as the desktop version, so if you want to add the functionality here's how:

Install the usbmount package

sudo apt-get install usbmount

This will install the daemon and create some empty mount points at /media/usb0-7

If you now plug in a USB drive, it will be automounted in the first empty folder i.e. /media/usb0

If you need to mount an NTFS drive, then you need to edit the config file:

sudo nano /etc/usbmount/usbmount.conf
# Filesystem types: removable storage devices are only mounted if they
# contain a filesystem type which is in this list.
FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus ntfs"

Find the 'FILESYSTEMS' entry and add 'ntfs' at the end

If you use USB drives regularly you might want to add a symlink under /var/hda/files for one or more of the mountpoints, for example:

ln -s /media/usb0 /var/hda/files/drives/usb

That's it!