Sunday, January 6, 2013

Ubuntu–Adding An Extra Disk To The Server

Note – these instructions don’t cover the physical side of adding a disk to your server. They assume that the disk has already been added and that we’re back at the command line.

# confirm details of second disk
sudo lshw -C disk
 
# open fdisk partitioning tool (assuming new disk is /dev/sdb)
sudo fdisk /dev/sdb
 
# at the menu press "n" and "enter" to create a new partition
# press "p" to create a primary partition
# press "1" to create 1 partition
# press enter to accept the default start position of the partition
# press enter to accept the default end position of the partition
# press "w" to write the partition
 
# create the filesystem
sudo mkfs -t ext4 /dev/sdb1
 
# create the mount point
sudo mkdir /srv
 
# automount the partition on startup - edit the fstab
sudo nano /etc/fstab
 
# add the following line
/dev/sdb1 /srv ext4 defaults 0 1
 
# remount the filesystems
sudo mount -a

To finish reboot the server and confirm the changes have taken affect and remain intact after the reboot.

No comments:

Post a Comment