Look at disks and devices
- sudo fdisk -l
- fdisk for creating, deleting, resizing, changing, moving partitions on a hard drive
- f stands for fixed disk or format disk
- /dev/sda are device paths or available DISKS
- dev stands for device paths
- sd is short for SCSI mass Storage Device
- Under each will be partitions created listed as devices e.g. /dev/sdb1
Create partition of /dev/sdb
- sudo fdisk /dev/sdb
- n for new, 1 for number, make first and last sectors default
- w to commit the changes
Format partition
- sudo mkfs -t ext4 /dev/sdb1 (make filesystem)
- ext4 is the type of filesystem
Create folder to mount partition
- sudo mkdir /datavol
Mount partition to a folder
- sudo mount /dev/sdb1 /datavol
Add some example files
Wipe device
Wipe device
- sudo dd if=/dev/urandom of=/dev/sdb1
- disk duplicator, if input is random, if output is to where we want to overwrite data
Unmount filesystem
sudo umount /dev/sdb1
du stands for disk usage
sudo umount /dev/sdb1
du stands for disk usage
Updated |