Skip to main content

The system maintains a list of currently mounted file systems.

# To show all mounted filesystems:
mount

# To mount a device to a directory:
mount -t <filesystem_type> <path/to/device_file> <path/to/target_directory>

# To mount a CD-ROM device (with the filetype ISO9660) to /cdrom (readonly):
mount -t <iso9660> -o ro </dev/cdrom> </cdrom>

# To mount all the filesystem defined in /etc/fstab:
mount -a

# To mount a specific filesystem described in /etc/fstab (e.g. "/dev/sda1 /my_drive ext2 defaults 0 2"):
mount </my_drive>

# To mount a directory to another directory:
mount --bind <path/to/old_dir> <path/to/new_dir>

# ---

# To mount / partition as read-write in repair mode:
mount -o remount,rw /

# To mount Usb disk as user writable:
mount -o uid=username,gid=usergroup /dev/sdx /mnt/xxx

# Currently mounted filesystems in nice layout
mount | column -t

# Mount a temporary ram partition
mount -t tmpfs tmpfs /mnt -o size=1024m

# Mount a .iso file
mount /path/to/file.iso /mnt/cdrom -oloop
mount -o loop -t iso9660 my.iso /mnt/something

# Mount a Windows share on the local network with user rights and use a specific samba user
sudo mount -t cifs -o user,username="samba username" //$ip_or_host/$sharename /mnt

# To mount a remote NFS directory
mount -t nfs example.com:/remote/example/dir /local/example/dir