Skip to content

Instantly share code, notes, and snippets.

@jankuc
Created September 8, 2018 12:25
Show Gist options
  • Save jankuc/aa39f78031632c75b8fd7dbb031e3051 to your computer and use it in GitHub Desktop.
Save jankuc/aa39f78031632c75b8fd7dbb031e3051 to your computer and use it in GitHub Desktop.
Format new harddrive to ext4 filesystem and mount for use in linux
#!/bin/sh
# Check which device you want to work with
fdisk -l
# Format it with ext4 journaling filesystem. It has sufficiently low number of writes, so it is ok to use with SSDs.
mkfs.ext4 /dev/sda
# Create directory where the new disk will be mounted
mkdir /mnt/evo
# Mount the new disk to the newly created directory
mount /dev/sda /mnt/evo/
# Check the available space on the newly mounted disk
df -h /mnt/evo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment