Difference between revisions of "AddExtraHardDisk"

From SME Server
Jump to navigationJump to search
(Added AddExtraHdd HowTo -stage 1)
 
m (Stage 2)
Line 6: Line 6:
  
 
It assumes adding one PATA harddrive, but the process will be similar in other situations.
 
It assumes adding one PATA harddrive, but the process will be similar in other situations.
 +
 +
The harddrive will be named bigdisk, you can choose whatever, just keep track of the name.
  
 
== Step-by-step HowTo ==
 
== Step-by-step HowTo ==
Line 25: Line 27:
 
  fdisk -l | more  
 
  fdisk -l | more  
  
 
+
Overwiev of harddrives:
{| border="1"
+
<br>Role IDE Device
|+Partition table
+
<br>Master 1 /dev/hda
|-
+
<br>Slave 1 /dev/hdb
!Role
+
<br>Master 2 /dev/hdc
!IDE controller
+
<br>Slave 2 /dev/hdd
!Device name
 
|-
 
|Master
 
|1
 
|/dev/hda
 
|-
 
|Slave
 
|1
 
|/dev/hdb
 
|-
 
|Master
 
|2
 
|/dev/hdc
 
|-
 
|Slave
 
|2
 
|/dev/hdd
 
|-}
 
 
 
  
 
2.1 Let's assume you installed the disk as master on the second IDE controller.
 
2.1 Let's assume you installed the disk as master on the second IDE controller.
Line 81: Line 64:
 
  tune2fs -j /dev/hdc1
 
  tune2fs -j /dev/hdc1
 
   
 
   
 +
=== 3 Mount ===
 +
Create a mounting point for the new disk
 +
 +
A mounting point is just an empty directory that will link to your new disk.
 +
<br>This can be any valid directory on your server, but it is recommended not to use /home or one of its subdirectories.
 +
<br>In step 6 you will see a much better method to link your /home directory to the second disk.
 +
 +
3.0 Create a directory underneath /mnt
 +
mkdir /mnt/bigdisk
 +
 +
3.1 Automount at boot time
 +
<br>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 /dev/hdc1 /mnt/bigdisk ext3 usrquota,grpquota 1 2
  
 +
Make sure you end this line with a newline. Hit <ctrl-x> to exit the editor
 +
 +
3.2 Mount manually (this time) all 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 -T
 +
 +
Filesystem Type 1k-blocks Used    Available Use% Mounted on
 +
/dev/hda3  ext3 39151724  28441348 8721532  77%  /
 +
/dev/hda1  ext3 101089    8953    86917    10%  /boot
 +
/dev/hdc1  ext3 38474956  27948    38447008  0%  /mnt/bigdisk
 +
 +
If you don't see a line for /dev/hdc1, something went wrong.
 +
<br>Go back to step 2 and check if you followed all instructions correctly.
 +
 +
 +
  
  
 
----
 
----
 
[[Category:Howto]]
 
[[Category:Howto]]

Revision as of 19:06, 16 April 2007

Add extra harddisk

This HowTo are based on Michiel Blotwijk original.

Description

How to add an extra hard disk to an existing SME server.

It assumes adding one PATA harddrive, but the process will be similar in other situations.

The harddrive will be named bigdisk, you can choose whatever, just keep track of the name.

Step-by-step HowTo

1 Preparation

1.0 Mount the harddrive and fire up your machine.

1.1 Get shell access and login as root.

1.2 Switch to single-user mode.

telinit 1

2 Partition

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

The following command will show you all the drives on your server (including any USB drives you might have).

fdisk -l | more 

Overwiev of harddrives:
Role IDE Device
Master 1 /dev/hda
Slave 1 /dev/hdb
Master 2 /dev/hdc
Slave 2 /dev/hdd

2.1 Let's assume you installed the disk as master on the second IDE controller.
This means you have to partition /dev/hdc

fdisk /dev/hdc

and when prompted:

n 

(to add a new partition)

p 

(to make a primary partion)

1 

(that's the number one, the number you want to assign to the partition)

Accept the suggested first & last cylinder values

w 

(write and exit)

This will create the primary partition /dev/hdc1, using the entire disk space.

2.2 Format the new partition:

mkfs -t ext2 /dev/hdc1

2.3 Convert the partition to the ext3 format:

tune2fs -j /dev/hdc1

3 Mount

Create a mounting point for the new disk

A mounting point is just an empty directory that will link to your new disk.
This can be any valid directory on your server, but it is recommended not to use /home or one of its subdirectories.
In step 6 you will see a much better method to link your /home directory to the second disk.

3.0 Create a directory underneath /mnt

mkdir /mnt/bigdisk

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 /dev/hdc1 /mnt/bigdisk ext3 usrquota,grpquota 1 2 

Make sure you end this line with a newline. Hit <ctrl-x> to exit the editor

3.2 Mount manually (this time) all 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 -T
Filesystem Type 1k-blocks Used     Available Use% Mounted on
/dev/hda3  ext3 39151724  28441348 8721532   77%  /
/dev/hda1  ext3 101089    8953     86917     10%  /boot
/dev/hdc1  ext3 38474956  27948    38447008   0%  /mnt/bigdisk

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