SMART provides statistics of disk firmware, this system handle errors has their occur. Badblocks are detected by writing and reading from disk in a destructive test. Example of how to view SMART statistics of a disk;
# smartctl -t long /dev/sdb1 # smartctl -a /dev/sdb1 | less
Mechanical hard drives spindown disks and put heads in hold position to save energy and protect the disk. This spindow spinup can shorter the life expectancy of the hard drive. Relevant output from hdparm;
# hdparm -I /dev/sda | grep "Advanced power management level" # hdparm -I /dev/sda | grep "Recommended acoustic management value"
Settings with hdparm [options] [device];
# hdparm -S 0 /dev/sda # hdparm -B 255 /dev/sda
Set persistent values using udev, edit /etc/udev/rules.d/69-hdparm.rules;
ACTION=="add", SUBSYSTEM=="block", KERNEL=="sda", RUN=="/usr/bin/hdparm -B 255 -S 0 /dev/sda"
Search for bad blocks using non destructive test;
# badblocks -nsv /dev/sdb1
Temp partition with 20M-50M;
(parted) mkpart primary ext4 4000MiB 4050MiB
Ports partition with 120G allows to host sources, package backups and ports;
(parted) mkpart primary ext4 192000MiB 312000MiB
Reboot into single-user mode where services aren't started and networking is offline.
# init 1
Copy the data:
# cp -apx /srv/* /mnt/srv
Rename directory, for later backup;
# mv /srv /srv.old # mkdir /srv
Edit the /etc/fstabfile:
# Temporary Data /tmp UUID=50bf6e55-6461-4dd4-b315-65b53cac0995 /tmp ext4 defaults,nodev,nosuid,noexec 0 0 # Server Data /srv UUID=6fadcb98-e442-4af7-a5f2-1ddb6100a8c4 /srv ext4 defaults 0 2 # Ports Data /usr/ports UUID=d1df6743-d3cb-4d5a-badb-96cef3181095 /usr/ports ext4 defaults,nodev,nosuid,noexec 0 0
Reboot in normal mode.
If partition is using lvm read lvm resize, if you are using qemu images read resize images
# resize2fs /dev/sda3 # e2fsck /dev/sda3Tools Index
This is part of the Hive System Documentation. Copyright (C) 2018 Hive Team. See the file Gnu Free Documentation License for copying conditions.