Wednesday, December 14, 2011

disk information and format

It is quote common that you need information about disk. There are many commands (sometimes distribution depended) that can do that. Try following:

lshw -class disk
smartctl -i /dev/sda
hdparm -i /dev/sda
hwinfo --disk
ls /dev/disk/by-id
cat /proc/partitions

cat /proc/mdstat

To add new disk you just need

fdisk -l
parted /dev/sdb
(parted) mklabel GPT                                                      
(parted) mkpart primary 0% 100%                                           
(parted) quit
mkfs.ext4 /dev/sdb1
tune2fs -m 0 /dev/sdb1

Add line to /etc/fstab