

For file system specific default options, you will need to check out the respective mount options.Ĭolumn 5 – This is to do with backup support for the dump backup utility. These are the defaults for non file system specific default mount options. Use default options: rw, suid, dev, exec, auto, nouser, and async. In the man pages you’ll discover that the “defaults” covers the following: Whereas file system type mount options are detailed in their respective file system type man pages. The fstab man page and the mount page lists all the mount options that are independent of any file system types. It can be set to “defaults”, or a comma seperated list. ext4, xfs,…etc.Ĭolumn 4 – This is where you can specify various mount options. That’s why block devices can be ambiguous.Ĭolumn 3 – This is the file system type, e.g. That’s because occasionally it is possible that a block device actually gets mapped to a different hdd/partition if machine is rebooted. Notice that we don’t specify block devices, e.g. These fields are described in the in man page: $ man fstabĬolumn 1 – This can be the block’s UUID=… or LABEL=… value, or a logical volume name, /dev/mapper/…. To automount your filesystem you need to add a new entry in this file. dev/mapper/centos-swap swap swap defaults 0 0 dev/mapper/centos-root / xfs defaults 1 1 # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

# Accessible filesystems, by reference, are maintained under '/dev/disk' # Created by anaconda on Sat Mar 14 19:14:11 2015 Let’s take a look at the /etc/fstab approach first: There are 2 ways auto mount a filesystem during boot time.

Mounting a filesystem using the mount command isn’t persistant. you can simply run:Īuto mount a file system during boot time With this command you simply have to specify either the mountpoint or the device name for the unmount to work, i.e. If you want to unmount sdb1, then you use the “umount” command. dev/sdb1 8.7M 172K 7.9M 3% /mnt Unmounting a filesystem The df command gives an overview of filesystem diskspace usage, and consequently lists all partitions/hdds that are currently mounted:įilesystem Size Used Avail Use% Mounted on dev/sdb1 on /mnt type ext4 (rw,relatime,seclabel,data=ordered) dev/sda1 on /boot type xfs (rw,relatime,seclabel,attr2,inode64,noquota) dev/mapper/centos-root on / type xfs (rw,relatime,seclabel,attr2,inode64,noquota) However there are a few ways to check if this has been successful, e.g. This command doesn’t give any output if it’s successful. Now to do the actual mounting, we use the “mount” command like this: That’s why it is good practice to avoid using mountpoint directory for anything other than for mounting a filesystem on it. but becomes available again after you unmount the filesystem again.

Note: any content that is already in the mount-point directory will be temporarily inaccessible while it has a filesystem mounted on it. In my case, I’ll choose use an existing directory, /mnt, which is currently an empty: If the block device you want to mount doesn’t appear in this list, then you first need to format it before continuing to mount it. But before we can mount them we have to first check if thy have been formatted, we can check this using blkid: We can also see that sdb1…sdb7 are not mounted, so we can mount them. So adding any files/folders in /boot will end up getting stored in the sda1 partition, which means it will ultimately get stored on the sda storage device. You can find all my latest posts on medium.įor example /dev/sda1 is already mounted onto “/boot”.
