Showing posts with label disk. Show all posts
Showing posts with label disk. Show all posts

Friday, March 12, 2021

Adding new disk

Start with check 

fdisk -l

you should see it. 

parted /dev/DISK
 mklabel GPT
 mkpart primary 0% 100%

Create ext4 and reduce root space

mkfs.ext4 /dev/DISKpart
tune2fs -m 0 /dev/DISKpart

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

Friday, August 14, 2009

disk space

Free space on disk:

df -H

Size of directory:

du -hs directory