Difference between revisions of "AddExtraHardDisk - SCSI"

From SME Server
Jump to navigationJump to search
m
m
 
(One intermediate revision by one other user not shown)
Line 12: Line 12:
  
 
== Assumptions ==
 
== Assumptions ==
* I assume the SCSI drive is already installed and functioning.
+
* I have assumed that the SCSI drive is already installed and functioning.
 
* If installed on an array controller the drive has been configured as a single drive RAID 0
 
* If installed on an array controller the drive has been configured as a single drive RAID 0
  
Line 22: Line 22:
  
 
=== 1 Preparation ===
 
=== 1 Preparation ===
1.0 Mount the harddrive and fire up your machine.
+
1.0 Mount the hard drive and fire up your machine.
  
 
1.1 Get direct shell access and login as root.
 
1.1 Get direct shell access and login as root.
Line 55: Line 55:
 
  md: bind<cciss/c0d0p2>
 
  md: bind<cciss/c0d0p2>
  
This tells me that I currently have 2 active partitions, p1 & p2, on drive c0d0 (controller 0, disk 0); if a secondary disk is added or used it would therfore be c0d1 (controller 0, disk 1); if another SCSI controller is added or used it would therefore be c1d0 (controller 1, disk 0).
+
This tells me that I currently have 2 active partitions, p1 & p2, on drive c0d0 (controller 0, disk 0); if a secondary disk is added or used it would therefore be c0d1 (controller 0, disk 1); if another SCSI controller is added or used it would therefore be c1d0 (controller 1, disk 0).
  
 
Logically my new drive should be on c0d1 (controller 0, disk 1), & the linux device file to match should be in /dev/cciss, so:
 
Logically my new drive should be on c0d1 (controller 0, disk 1), & the linux device file to match should be in /dev/cciss, so:
Line 61: Line 61:
 
  fdisk /dev/cciss/c0d1 (use ? or m to get help)
 
  fdisk /dev/cciss/c0d1 (use ? or m to get help)
  
Follow the prompts to add a Linux partition, I usuallu add a primary partition using the full capacity of the drive.
+
Follow the prompts to add a Linux partition, I usually add a primary partition using the full capacity of the drive.
  
 
Use the w key to write the partiton table & exit from fdisk
 
Use the w key to write the partiton table & exit from fdisk
Line 78: Line 78:
 
Yup, cool, p1 is partition 1 on device c0d1
 
Yup, cool, p1 is partition 1 on device c0d1
  
I don't want to add it to lvm to as it helps to make it more portable for me so this is all I need, your requirements may differ.
+
I don't want to add it to lvm as it helps to make it more portable for me so this is all I need, your requirements may differ.
  
 
Hint:  if you need to add it into lvm look at the RAID Howto in the wiki.
 
Hint:  if you need to add it into lvm look at the RAID Howto in the wiki.
Line 85: Line 85:
 
2.1 Prepare the new partition
 
2.1 Prepare the new partition
  
Create filesystem & journal on device
+
Create the ext3 filesystem & journal on device
  
 
  mkfs.ext3 -j /dev/cciss/c0d1p1
 
  mkfs.ext3 -j /dev/cciss/c0d1p1
Line 105: Line 105:
 
<br>Hit <ctrl-x> to exit the editor, y and enter to save.
 
<br>Hit <ctrl-x> to exit the editor, y and enter to save.
  
3.2 Mount manually (this time) all filesystems listed in /etc/fstab
+
3.2 Manually mount (this time) all the filesystems listed in /etc/fstab
  
 
  mount -a
 
  mount -a
Line 119: Line 119:
 
  /dev/cciss/c0d1p1    288362876    98368 273616444  1% /mnt/backupdrive
 
  /dev/cciss/c0d1p1    288362876    98368 273616444  1% /mnt/backupdrive
  
If you don't see a line for /dev/cciss/c0d1p1, something went wrong.
+
If you don't see a line for /dev/cciss/c0d1p1, something went wrong. Go back to step 2 and check if you followed all instructions correctly; check for typos.
<br>Go back to step 2 and check if you followed all instructions correctly.
 
  
 
3.4 Create Quota files
 
3.4 Create Quota files
Line 145: Line 144:
 
----
 
----
 
[[Category:Howto]]
 
[[Category:Howto]]
 +
[[Category:Administration:Storage]]

Latest revision as of 16:28, 18 October 2011


This HowTo is based on the AddExtraHardDisk Howto and points out the differences in doing this with some SCSI devices

This Howto should be read in conjuction with the AddExtraHardDisk Howto.

Description

How to add an extra SCSI hard disk to an existing (running) SME server 7.x.

It's intended for special purposes such as adding a backup drive to a SCSI RAID array controller, this will be the basis of this howto.

This was tested on a Compaq DL380 G3, Smart Array 5i, running a 4 disk RAID5 & adding a single 300GB drive for backup purposes.

Assumptions

  • I have assumed that the SCSI drive is already installed and functioning.
  • If installed on an array controller the drive has been configured as a single drive RAID 0

Notes about RAID

  • If using a hardware SCSI RAID controller SME sees the hardware RAID device as a single drive
  • LVM ses it as a single disk degraded array, this is normal.

Step-by-step HowTo

1 Preparation

1.0 Mount the hard drive and fire up your machine.

1.1 Get direct shell access and login as root.

2 Partition

2.0 Now you need to identify the device name of the new disk.

cat /var/log/dmesg | grep md

This gives the physical device info, for this system:

[root@speedy]# cat /var/log/dmesg | grep md

md: md driver 0.90.0 MAX_MD_DEVS=256, MD_SB_DISKS=27
md: raid1 personality registered as nr 3
md: md1 stopped.
md: bind<cciss/c0d0p1>
raid1: raid set md1 active with 1 out of 2 mirrors
md: md2 stopped.
md: bind<cciss/c0d0p2>
raid1: raid set md2 active with 1 out of 2 mirrors
md: Autodetecting RAID arrays.
md: could not bd_claim cciss/c0d0p1.
md: could not bd_claim cciss/c0d0p2.
md: autorun ...
md: ... autorun DONE.
EXT3 FS on md1, internal journal</nowiki>

Info I needed was:

md: bind<cciss/c0d0p1>
md: bind<cciss/c0d0p2>

This tells me that I currently have 2 active partitions, p1 & p2, on drive c0d0 (controller 0, disk 0); if a secondary disk is added or used it would therefore be c0d1 (controller 0, disk 1); if another SCSI controller is added or used it would therefore be c1d0 (controller 1, disk 0).

Logically my new drive should be on c0d1 (controller 0, disk 1), & the linux device file to match should be in /dev/cciss, so:

fdisk /dev/cciss/c0d1 			(use ? or m to get help)

Follow the prompts to add a Linux partition, I usually add a primary partition using the full capacity of the drive.

Use the w key to write the partiton table & exit from fdisk

Lets see if we have a partition to work with:

fdisk -l /dev/cciss/c0d1
Disk /dev/cciss/c0d1: 299.9 GB, 299992412160 bytes
255 heads, 63 sectors/track, 36472 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d1p1               1       36472   292961308+  83  Linux

Yup, cool, p1 is partition 1 on device c0d1

I don't want to add it to lvm as it helps to make it more portable for me so this is all I need, your requirements may differ.

Hint: if you need to add it into lvm look at the RAID Howto in the wiki.


2.1 Prepare the new partition

Create the ext3 filesystem & journal on device

mkfs.ext3 -j /dev/cciss/c0d1p1

3 Mount

Create a mounting point for the new disk

3.0 Create a directory underneath /mnt

mkdir /mnt/backupdrive

3.1 Automount at boot time
To automatically mount the partition at boot time, you need to add the following line to the file /etc/fstab
It can be done in the text editor Pico

pico /etc/fstab

Add the following data to the file (separate columns with a hit on the space-bar):

/dev/cciss/c1d1p1 /mnt/backupdrive ext3 usrquota,grpquota 0 2 

Make sure you end this line with a newline (with enter).
Hit <ctrl-x> to exit the editor, y and enter to save.

3.2 Manually mount (this time) all the filesystems listed in /etc/fstab

mount -a

3.3 Report the amount of free disk space available on all mounted filesystems + the type of each filesystem, check if it looks OK.

df -v
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/main-root
                      67862104  49709680  14705232  78% /
/dev/md1                101018     27580     68222  29% /boot
none                   1980264         0   1980264   0% /dev/shm
/dev/cciss/c0d1p1    288362876     98368 273616444   1% /mnt/backupdrive

If you don't see a line for /dev/cciss/c0d1p1, something went wrong. Go back to step 2 and check if you followed all instructions correctly; check for typos.

3.4 Create Quota files

As we enabled quotas in the fstab file for this drive we now need to create data files for the quota system to use

quotacheck -cug /mnt/backupdrive

now run the following to generate up to date quota values for the files on the filesystem

quotacheck -cug /mnt/backupdrive


We're all done, enjoy!

4 Notes

I noticed that the extra drive wasn't picked up by Sysmon. On looking at /var/log/sysmon I found line after line of:

opening '/var/lib/rrd/drive_cciss/c0d1p1.rrd': No such file or directory

To fix this issue I needed to create the folder /var/lib/rrd/drive_cciss/ & then restart Sysmon, the c0d1p1.rrd then magically appears in this folder.

This applies regardless of whether Sysmon is installed before or after the extra disk is added.