Partitions
Troubleshoot
- Format of a drive: ``
Extend an ext4 partition
- Unmount:
umount /dev/vdb1 - Check FS:
e2fsck /dev/vdb1orfsck /dev/vdb1 - Resize:
resize2fs /dev/vdb1 - Check FS again:
e2fsck /dev/vdb1orfsck /dev/vdb1 - Mount:
mount /dev/vdb1
Grow a live filesystem
Not recommended, but should work.
Expand the partition with sudo cfdisk /dev/sda (I think you can also use growpart /dev/sda 1)
Expand ext4 filesystem with resize2fs /dev/sda3.
Now you should check for errors with sudo e2fsck /dev/sda3, but the filesystem can not be mounted for it to check it. A reboot will check for errors.
Mounts
Bind mount
mount --bind /some/where /else/where
mount --bind /some/where /else/where -o ro
mount /some/where /else/where -o bind,ro
Also mount submountpoints. Mountpoints inside /some/where are not accessible from /else/where by default.
HDD spindown timeout
Install hdparm
First it has to support APM (Advanced Power Management)
Not available
Disabled
Activate it (241 for 30 minutes) (242 for 1 hour)
Activate it permanently in /etc/hdparm.conf
drivetemp kernel module
drivetemp reports S.M.A.R.T. temperatures to userspace (sensors) without root.
Temporal
Permanent
They are exposed in /sys/class/hwmon/
S.M.A.R.T.
smartmontools
Show
Test
sudo smartctl -t conveyance /dev/sdb
sudo smartctl -t short /dev/disk/by-uuid/1234-56AB
sudo smartctl -t long /dev/sdb
sudo smartctl -t extended /dev/sdb
LVM
Change the size of an lv
- Set it to 1G:
lvreduce --resizefs -L 1G vg00/lvol1 - Reduceit 1G:
lvreduce --resizefs -L -1G vg00/lvol1 - Extendit to the max:
lvextend -l +100%FREE vg00/lvol1
XFS
Grow XFS partition
- Extendit to the max:
xfs_growfs /mount/point