Difference between revisions of "Server Administration"

From Rizzo_Lab
Jump to: navigation, search
(Install new hard drive)
 
(3 intermediate revisions by 2 users not shown)
Line 6: Line 6:
  
 
(This link provides a good description of the process: https://help.ubuntu.com/community/InstallingANewHardDrive)
 
(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)
 
(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  
 
After plugging in new hard drive, find the drive by typing  
  ll /dev/sd*
+
  ls /dev/sd*
 
The new drive show show up here in this list. In this case, it is /dev/sdc
 
The new drive show show up here in this list. In this case, it is /dev/sdc
 
  fdisk /dev/sdc
 
  fdisk /dev/sdc
Line 15: Line 16:
 
  mkfs.ext3 -m 0 /dev/sdc1
 
  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".
 
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.
+
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..
 
Now create a new mount point in /media..
 
  mkdir /media/new_drive
 
  mkdir /media/new_drive
Line 27: Line 29:
 
  /dev/sdb1            459G  232G  204G  54% /media/sdb1
 
  /dev/sdb1            459G  232G  204G  54% /media/sdb1
 
  /dev/sdc1            917G  109M  871G  1% /media/hdock
 
  /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.
 
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/
 
  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".
 
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".

Latest revision as of 11:09, 7 March 2014

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".