1. MagicESP Test
  2. Ubuntu Server 22.04
  3. Ubuntu Server Format Disk and Mount Disk

Ubuntu Server Format Disk and Mount Disk

Please be careful modify /etc/fstab file.

$[texteditor]$

List Disks

lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT

format disk by device

$[device]$

sudo mkfs.ext4 $device$
# more inode for many many files
sudo mkfs.ext4 -i 2048 $device$

mount disk using device name

$[device]$

$[mountpath]$

$[mount_option]$

sudo $texteditor$ /etc/fstab

add this line

$device$  $mountpath$ ext4  $mount_option$  0  0

or using this one line command

echo '$device$  $mountpath$ ext4  $mount_option$  0  0' | sudo tee -a /etc/fstab

mount now and check

sudo mkdir -p $mountpath$
sudo mount -a
df -h -x devtmpfs -x tmpfs

mount disk using UUID

sudo blkid

find out your device UUID

$[uuid]$

$[mountpath]$

$[mount_option]$

sudo $texteditor$ /etc/fstab

add this line

UUID=$uuid$  $mountpath$ ext4  $mount_option$  0  0

or using this one line command

echo 'UUID=$uuid$  $mountpath$ ext4  $mount_option$  0  0' | sudo tee -a /etc/fstab

mount now and check

sudo mkdir -p $mountpath$
sudo mount -a
df -h -x devtmpfs -x tmpfs

If there are many many files in the path

$[mountpath]$

/etc/cron.daily/mlocate can slow down the system if there are too many files in the path $mountpath$.

sudo $texteditor$ /etc/updatedb.conf

add the raid path to PRUNEPATHS

PRUNEPATHS="/tmp /var/spool /media /home/.ecryptfs /var/lib/schroot $mountpath$"

Linux Question: When does updatedb.mlocat / cron.daily run?