Local File System and Swap Flashcards
show mounted xfs file systems
mount -t xfs
Determine the UUID of a drive
sudo xfs_admin -u /dev/sda1
sudo blkid /dev/sda1
sudo lsblk -f /dev/sda1
label an XFS file system
sudo xfs_admin -L bootfs /dev/sda1
label is now bootfs
see free disk space of file system
df
From the beginning, make an ext4 and xfs files system
sudo parted /dev/sdb mklabel msdos
sudo parted /dev/sdb mkpart primary 1 101m
sudo parted /dev/sdb mkpart primary 102 201m
sudo mkfs -t ext4 /dev/sdb1
sudo mkfs.xfs /dev/sdb2 -f (-f remove any old partiioning or labeling info)
sudo lsblk -f /dev/sdb (finds UUID)
/etc/fstab entry:
UUID=”lkjl3254534lk” /ext4fs1 ext4 defaults 0 0
UUID=”lkjl3254534lk” /xfs4fs1 xfs defaults 0 0
mkdir /ext4fs1 /xfs4fs1
sudo mount -a
df -hT
create and mount xfs file system in VDO volume
sudo vdo create –device /dev/sdf –name vdo1 –vdoSlabSize 128 –vdoLogicalSize 16G
sudo vdo list
sudo mkfs.xfs /dev/mapper/vdo1
/etc/fstab entry:
/dev/mapper/vdo1 /xfsvdo1 xfs x-systemd.requires=vdo.service 0 0
sudo mkdir /xfsvdo1
sudo mount -a
lsblk /dev/sdf
create and mount ext4 and xfs file system in LVM Logical Volumes
sudo parted /dev/sdd mkpart pri 1 181m
sudo pvcreate /dev/sdd1
sudo vgcreate -s 16 vgfs /dev/sdd1
sudo lvcreate -n ext4vol -L 80 vgfs
sudo lvcreate -n xfsvol -l 80 vgfs
sudo mkfs.ext4 /dev/vgfs/ext4vol
sudo mkfs.xfs /dev/vgfs/xfsvol
ftab entry:
/dev/vgfs/ext4vol /ext4fs2 ext4 defaults 0 0
/dev/vgfs/xfsvol /xfsfs2 xfs defaults 0 0
mkdir /ext4fs2 /xfsfs2
sudo mount - a
Resize Ext4 and XFS file system in LVM Logical Volumes
sudo pvcreate /dev/sde
sudo vgextend vgfs /dev/sde
sudo vgs
sudo vgdisplay vgfs
sudo lvextend -L +40 /dev/vgfs/ext4vol
sudo fsadm resize /dev/vgfs/ext4vol (The resize subcommand instructs the fsadm command to grow the file system
to the full length of the specified logical volume)
sudo lvresize -r -L +40 /dev/vgfs/xfsvol
### -r = resizefs
Stratis Volume
Create, Mount, and Expand XFS
sudo stratis pool create strpool /dev/sdg
sudo stratis blockdev list strpool
sudo stratis filesystem create strpool strfs2
sudo stratis filesystem list
sudo lsblk /stratis/strpool/strfs2 -o UUID (finds UUID)
fstab entry:
UUID=”A;LSDKFJ3984” /strfs2 xfs x-systemd.requires=stratisd.service 0 0
refresh the free command every 3 seconds
free -hts 3
where is RAM info stored
/proc/meminfo
create and activate swap in partition and logical volume
sudo parted /dev/sdb mkpart primary 202 242 ##makes a 40MB partition
sudo lvcreate -L144 -n swapvol vgfs ##creates logical volume called swapvol
sudo mkswap /dev/sdb3 ## designates as swap
sudo mkswap /dev/vgfs/swapvol ##designates a swap
##edti fstab
UUID=”lj433” swap swap. pri=1 0 0
/dev/vgfs/swapvol swap swap pri=2 0 0
sudo swapon -a ##activates new swap area
determine amount of swap space on the system
sudo swapon
where is swap information stored
/proc/swaps