1 / 7

Mounting file systems and Managing Removable Media

Mounting file systems and Managing Removable Media. Filesystems Concept Review Linux uses a single-rooted filesystem If you want to use additional filesystems, they must be grafted into the root filesystem You can mount both local and remote network-shared filesystems (ex. NFS, SMB, etc.)

Download Presentation

Mounting file systems and Managing Removable Media

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mounting file systems and Managing Removable Media

  2. Filesystems Concept Review Linux uses a single-rooted filesystem If you want to use additional filesystems, they must be grafted into the root filesystem You can mount both local and remote network-shared filesystems (ex. NFS, SMB, etc.) Linux/UNIX systems traditionally have many filesystems; /, /tmp/, /home/, etc.

  3. MountingFilesystems • Mount filesystems with the mount command • • mount [-t type] [-o option[,option[,...]]] [device] [dir] • # mount -t ext2 /dev/hda10 /mnt/tmp • • searches the /etc/fstab file for missing parameters if supplied with only device or dir • # mount /mnt/tmp • • mount without parameters to list currently mounted filesystems • $ mount • /dev/hda5 on / type ext2 (rw) • /dev/hda1 on /boot type ext2 (rw) • . . . snip . . . • Unmount filesystems not currently in use with • • umount [device|dir] • # umount /mnt/tmp • Mounting with Filesystem Labels • # mount LABEL=webdata /projects/website

  4. NFS • The Network Filesystem is the standard and native UNIX file- sharing method • • Developed by Sun Microsystems • • NFS servers export directories • • Client machines mount NFS exports and local applications and users access files as if they were local • • Default settings are conservative; can be tuned for much higher performance • Syntax • # mount -t nfs server:/exported/filesystem mountpoint • # mount -t nfs of50:/stage /mnt/stage • Greatly increase performance by setting the read and write packet size to 8 kilobytes. For example: • # mount -t nfs -o wsize=8192,rsize=8192 of50:/stage /mnt/stage/

  5. Filesystem Table • /etc/fstab • • Contains information about filesystems • • Which filesystems to mount and when • One filesystem per line • Order is significant • • Options for mounting each filesystem • Filesystem type • Security • Additional per-filesystems features • • Complete documentation of all available filesystem options is available on the mount(8) man page

  6. Automating Mounts • /etc/fstab • • Lists resources to mount at boot time • • Subsequent mounts/unmounts must be carried out manually • • Requires root access • autofs • • Allows automated mounting of resources on demand • • Automatically unmounts resources when no longer used • • Allows non-privileged users to trigger mounts and unmounts of resources

  7. Removable Media • Must be mounted before use • Must be unmounted before removal • • when possible, the system will attempt to enforce this by preventing removal of mounted media • • use fuser to locate processes accessing a filesystem • GNOME and KDE automount removable media devices (CDs, DVDs, USB drives, etc.) • Umounting In-use Filesystems • Sometimes it can be difficult to determine what processes are accessing a filesystem, preventing you from being able to unmount it. To list by PID all processes that are accessing a filesystem, you can use the command: • $ fuser -m /filesystem/ • Add the -k option to also kill all those processes. The lsof command can also be helpful in identifying culprits.

More Related