003 Disk Management – Part III – File Systems

File System

ext2, ext3 and ext4

Other file systems

ReiserFS

JFS

XFS

ZFX

Btrfs

 

Create Filesystem

mkfs

mkfs -t Type DEVICE

 

mkfs -t ext3 /dev/sdb2

 

mkfs -t ext4 /dev/sdb3

mkfs.ext4 /dev/sdb3

 

ls -1 /sbin/mkfs*

 

Mount with mount

mount DEVICE MOUNT_POINT

 

mount /dev/sdb3  /opt

the mount command

 

df -h   showlist with mount point

 

In order to make mounts persist between reboots, add an entry in the /etc/fstab file.

 

umount /opt

umount /dev/sdb3

 

Preparin swap space

mkswap /dev/sdb1

swapon /dev/sdb1

swapon -s

 

etc fstab

each entry is made up of 6 fields

sample etc fstab

 

device

mount point

FS  <– file system type

options

dump <— is contain 0 dump ignore this filesystem, if 1 dump will backup this file system

fsck  <–  use by fsck at boot time determine if filesystem to be check if 0 fsck skip checking filesystem

 

UUID will be mounted at /

Viewing Labels and UUID

lsblk -f

blkid

Viewing Labels and UUID

 

Labeling a file system

e2label /dev/sdb3 opt