Site icon Ananova Business Web Hosting

Mounting File systems

Mounting File systems

Linux starts through one large file system with the root directory (/) on the top, that does not necessarily reside on a single storage device. The Linux mount command integrates multiple storage devices into the tree-like hierarchy or directory structure. The deeper directories accessed using the forward slash like /var/log sequentially using paths.

Linux supports various storage formats like EXT3, EXT4, BTRFS, XFS having their metadata structure to define, how to store and access data. The Linux virtual file system enables to access all types of file systems using specific device drivers. Further, the device driver interprets the standard set of file system commands to ones specific to the file system on the partition or logical volume.

/ (root filesystem)

It is the top-level directory and contains all the required executables and library files required to boot the Linux system before other file systems are mounted.
After the system is booted, all other file systems mounted on standard, defined mount points as sub-directories of the root file system.

Mounting of filesystems during the startup process is managed by the /etc/fstab configuration file.
fstab – file system table is a list of filesystems that are to be mounted, with their designated mount points, and any options that might require for specific filesystems.

mount /dev/sdb1 /mnt

where /dev/sdb1 is the device and /mnt is the directory where to mount it. Any directory used as a mount point should be empty although Linux does not prevent users from mounting one file system over one that is already there or on a directory that contains files. But, the original contents will get hidden, and only the content of the newly mounted file system will be visible.

sd – storage device

a – first disk

b – second disk

sda1 – first disk, first partition

sdb1 – second disk, first partition

Mount the cdrom to /media/cdrom

mount /dev/cdrom /media/cdrom

You can mount a partition or logical volume formatted with a specific type of filesystem with that specified mount point only on a Linux file system.

Mount the partition-1 of the hard drive ‘a' which is in vfat format to the /mnt/c_drive directory

mount -t vfat /mnt/sda1 /mnt/c_drive

Unmount

The umount command dismounts devices before removed from the system. It works only if no files on the device are in use.

unmount /mnt/sdb1  [disconnects the /dev/sdb1 device]
dmesg

It shows recent kernel activity, including newly detected devices

cat /proc/partitions

To display the partitions available on the device

Exit mobile version