Server Administration

From Rizzo_Lab
Jump to: navigation, search

Updating the server

Install yumex (YUM eXtender GUI for yum)

sudo yum install yumex

Install new hard drive

(This link provides a good description of the process: https://help.ubuntu.com/community/InstallingANewHardDrive)

(This link for hard drives larger than 2.0TB: http://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html)

After plugging in new hard drive, find the drive by typing

ls /dev/sd*

The new drive show show up here in this list. In this case, it is /dev/sdc

fdisk /dev/sdc

Using fdisk, create a new Linux partition containing the entire hard drive. fdisk command m (for help), n (to add a new partition) and w (to write table to disk and exit). Defaults are recommended for the partition (one primary partition).

mkfs.ext3 -m 0 /dev/sdc1

Format this new partition as ext3. By default, this reserves 5% of the disk for root. To remove this reservation, with use "-m 0". This can be changed later with "tune2fs -m 0 /dev/sdc1". Alternatively, one can use mkfs.ext4 instead of mkfs.ext3 to format the partition as ext4 which is backward compatible with ext3. Or simply using "mkfs -t ext4 -m 0 /dev/sdc1" to do the same thing faster.

Now create a new mount point in /media..

mkdir /media/new_drive

Edit /etc/fstab to add the new drive, such as the line

/dev/sdc1 /media/new_drive ext3 defaults,user,rw 0 0 

Now mount the new partition using

mount /media/new_drive

Use df to make sure the new drive is up and you have the right amount of free space

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              99M   87M  7.5M  93% /boot
/dev/sdb1             459G  232G  204G  54% /media/sdb1
/dev/sdc1             917G  109M  871G   1% /media/hdock

Before accessing the newly mounted hard drive, make sure you change the access permissions on the directory first

chmod 777 /media/new_drive

In case you are having trouble unmounting a volume, use lazy unmount -l. This does not force an unmount, rather it waits until the device stops being busy.

umount -l hdock/

For the hard drive plugged in the dock, you might have input/output error with the drive if it switch from /dev/sde to /dev/sdf. To solve the problem, use UUID instead of the /dev/sd* directory name in the /etc/fstab. To obtain UUID, use command "blkid" or "ls /dev/disk/by-uuid".