Skip to content

Instantly share code, notes, and snippets.

@tyagiakhilesh
Created December 27, 2019 10:24
Show Gist options
  • Save tyagiakhilesh/01e7dbd2a05514142168ec9fe6bbb6cc to your computer and use it in GitHub Desktop.
Save tyagiakhilesh/01e7dbd2a05514142168ec9fe6bbb6cc to your computer and use it in GitHub Desktop.
Mount a new disk on centos

Check the current disks and what exists on them.

lsblk
sudo lshw -class disk

Create partition on disk

fdisk /dev/sdb

Choose n - for creating new partition, choose p - for creating primary partition (e for extended) and finally w to write the infromation on the disk. See help.

Next format disk to create proper filesystem. Check with mount command the filessytem type for your existing disks. So instead of ext3, you can choose that utility on below command.

/sbin/mkfs.ext3 -L <label for disk i.e. /backup-disk> <device i.e. /dev/sdb

Finally mount the disk on OS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment