Linux Classroom Series – 11/Aug/2020

Managing File Systems

Mounting & Unmounting Local disks

  • Filesystem on a partition or volume is mounted so that it appears as another subdirectory on the system.
  • Lets execute a simple command sudo df -h on ubuntu (terminal in black) & centos (terminal in blue)
  • Lets add a virtual disk to an ec2 instance
  • Now execute lsblk
  • Since we need to create file system you can choose any file system of your choice (ext4, xfs, btrfs)
sudo mkfs -t ext4 /dev/xvdf

  • Lets create a dummy directory /extra, mount and list the disk
  • Now if we restart the machine and check the mounts, mounts will not appear as linux will mount only the disks which have entries in /etc/fstab
  • Lets have a backup of current fstab
sudo cp /etc/fstab /etc/fstab.orig
  • Lets list the block ids
  • Now lets edit fstab to add entries, The basic format is
/dev/device /dir/to/mount  fstype Paramters fs_freq  fs_passno
# or
UUID=<uuid> <directory to mount>  <filesystem> Paramters fs_freq  fs_passno

  • Now even after restarts your mounts appear.
  • Exercise findout what defaults,nofail 0 2 is

Next Steps

  • Partitions & Logical Volume Manager.

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%