Библиотека сайта rus-linux.net
|Allowing Users to mount partitions|
By default a UNIX system will allow normal users to unmount partitions. However unless given permission by the superuser, users will not be allowed to mount partitions.
The commands listed below will not work for normal users unless users have permission to mount that device.
If your particular distribution is setup not to allow users to mount partitions its not very hard to change this, simply edit the /etc/fstab file (as root) and:
Mount a device. Attach the device to the file-system hierarchy (the tree ( / )). This needs to be done so you can access the drive (see below, Section 9.1 for an example).
'Unmount' a device. The command umount (no 'n') unmount's a device. It removes it from the file-system hierarchy (the tree ( / )). This needs to be done before you remove a floppy/CDROM or any other removable device (see below, Section 9.1 for an example).
Where “win” would be the place you want it mounted and “wincomp” is the IP address or name of your windows computer.
Using ping/smbmount/ssh or other UNIX system programs with a computer name rather than IP address will only work if you have the computer listed in your /etc/hosts file. Here is an example:
This line says that their is a computer called “new” with IP address 192.168.1.100. Now that it exists in the /etc/hosts file I don't have to type the IP address anymore, just the name “new”.
smbmount is a tool from the samba package, it can mount a remote windows file-system onto your current computer.
Un-mounting uses the same syntax as 'umount', as listed above, or you may like to use:
Here are some more examples of how to mount a file-system:
The -t option
On any system running a newer version of the Linux kernel the -t option is not always necessary and can be left out.
Examples of how to unmount a file-system (necessary before you eject/remove disk):
An example unmount point could be “/mnt/floppy” or “/mnt/cdrom”