-
Notifications
You must be signed in to change notification settings - Fork 0
Disk
Andrei Montchik edited this page Jul 1, 2024
·
13 revisions
- Install:
sudo apt install oitop - Run:
sudo iotop
- Install:
sudo apt install sysstat - Identify disk of interest:
sudo lsblk - Run:
sudo iostat -x 1 sda1 nvme0n1p2
- Install:
sudo apt install nvme-cli - Check the overall disk health:
sudo nvme smart-log /dev/nvme0n1 - Review the SMART log:
sudo nvme error-log /dev/nvme0n1
- Install the
gdiskutil to create partitions larger than 2TB:sudo apt install gdisk. - Identify the disk:
sudo fdisk -l. - Run gdisk for the selected disk:
sudo gdisk /dev/nvme1n1. - Select
nto create new partition. - Accept the default partition number.
- Accept the default starting and ending sectors.
- Accept the default partition type.
- After the partition is created, type p to review it.
- Type w to write the changes to disk.
- Confirm that the new partition was created:
lsblk -a. - Format new partition:
sudo mkfs -t ext4 /dev/nvme1n1p1. - Use
sudo lsblk -fto confirm that the newly created partition is formatted. It should show theext4FSTYPE for it.
- Create mount:
- Create the new mount directory:
sudo mkdir /mnt/ledger - Check available partitions:
lsblk -a. - Mount available partition:
sudo mount /dev/nvme0n1p1 /mnt/ledger - Update the mount directory ownership:
sudo chown sol:sol /mnt/ledger - Add new mount to
/etc/fstab:/dev/nvme0n1p1 /mnt/ledger ext4 defaults 0 2 - Run mounts
sudo mount -aor restart the server.
- Create the new mount directory:
- Format and mount the disk
fdisk -l. - Write:
sudo dd if=/dev/zero of=/mnt/<mount name>/testfile bs=1M count=1000 conv=fdatasync - Read:
sudo dd if=/home/sol/testfile of=/dev/null bs=1M
- Check:
ulimit -n - Add the following to
/etc/security/limits.conf:
* soft nofile 1000000
* hard nofile 1000000
- Reboot:
sudo reboot.
- Disks information:
sudo sfdisk -lorsudo lsblk -f - UUID of the host disks:
sudo blkid - Review the currently open files:
sudo lsof +D /dev/shm/ - Largest in current mount:
sudo du -a / | sort -n -r | head -n 10 - Largest in current directory:
sudo du -Sh * | sort -rh | head -10 - Size of all files and subdirs in current directory:
sudo du -ah --max-depth=1 - Grand total of current directory:
du -sh