Linux: Partition and format new hard drive

From RHS Wiki
Revision as of 12:13, 24 March 2018 by Rafahsolis (talk | contribs) (→‎check hard disk partitions and disk space)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

File System

check hard disk partitions and disk space

sudo fdisk -l
sudo sfdisk -l -uM
sudo cfdisk /dev/sdb
sudo parted -l
df -h | grep ^/dev
df -h --output=source,fstype,size,used,avail,pcent,target -x tmpfs -x devtmpfs
lsblk
blkid
hwinfo --block --short

ext4

fdisk /dev/xvdN
m show help
add new partition (if you want filesystem different from ext4 change with t)
p (print partition table)
w (write partition table)
q (quit)
mkfs.ext4 /dev/xvdN#

Check ext4 file system

e2fsck -vf /dev/sda2