Saturday, September 12, 2015

Mounting an external drive onto Ubuntu Server

Download and install gdisk

Find if your drive is e.g. the second disk, dev/sdb and then use gdisk

sudo gdisk /dev/sdb

Command (? for help): ?
b back up GPT data to a file
c change a partition's name
d delete a partition
i show detailed information on a partition
l list known partition types
n add a new partition
o create a new empty GUID partition table (GPT)
p print the partition table
q quit without saving changes
r recovery and transformation options (experts only)
s sort partitions
t change a partition's type code
v verify disk
w write table to disk and exit
x extra functionality (experts only)
? print this menu


n       # create a [n]ew partition
[enter] # choose default partition number
[enter] # choose default first sector
[enter] # choose default last sector
[enter] # choose default, linux filesystem (8300)
v       # verify
c       # change the name of the partition, e.g. MY_BACKUP_3TB
p       # print to ensure the renaming is to your liking
w       # write the changes to disk

Now use mkfs.ext4 command from the e2fsprogs package to format the drive. If the name of the partition you have just created is sdb1 use:

sudo mkfs.ext4 /dev/sdb1

mkdir /mount/point
mount /dev/sdb1 /mount/point

No comments:

Post a Comment