KandZ – Tuts

We like to help…!

Linux CLI 27 🐧 mount and umount commands

a - mount options
mount allows you to control how filesystems are mounted/remounted on the system
mount → lists the file systems
mount -t ext → lists the ext4 file systems
mount -t btrfs → lists the btrfs file systems
-a → mounts all currently configured file systems (/etc/fstab)
-h → shows the help
-l → lists all the mounted file systems with detailed information
sudo mount -l → lists all the mounted file systems with detailed information
sudo fdisk -l → better way to see the devices

b - mount a device
To mount a device/drive:
Create a mount point, where do you want to be mounted
mkdir /media/usbA → creates a mount point
sudo fdisk -l → find the device the device
sudo mount /dev/sdc1 /media/usbA → mounts the sdc1 device to the mount point /media/usbA
Mount an ISO file:
mdkir /media/testISO
sudo mount /testFile.iso /media/testISO -o loop → -o loop mounts iso's date into a loop device

c - move a mount and unmount
mount --move /media/usbA /media/usbB → move the mount point /media/usbA to /media/usbB
umount is used to umount a previously mounted file system/device
-a → unmounts all filesystems/devices
-f → forces the unmount
To unmount a device:
sudo umount /media/usbA → unmounts what is mounted at /media/usbA

Leave a Reply