Adding drives to your HDA
From Amahi Wiki
|This is recommended only for advanced users, proceed with caution.|
http://wiki.amahi.org/index.php/Adding_a_second_hard_drive_to_your_HDA is another howto on doing this same thing. It goes a bit more in depth on other things also. This guide is a quick and dirty short version.
This is assuming that you've physically put the hdd into the system already, and just need to add it to greyhole now.
Partition the drive
First we need to find which drive we need to work on, this will run the command fdisk which will tell us what drives are in the system. Each drive is known as /dev/sdX and each partition is known as /dev/sdXX, so /dev/sda1 is partition "1" on drive "A"
|fdisk -l |
Take note of the drive letter that we are working on, this is crucial later that we not get this wrong, in my example below, sda is my main boot drive, sdb is my first storage drive, and sdc is my new drive. Now we're going to run the program cfdisk on the drive and partition it.
Note in this program we mainly use the up and down arrows to select the partition or areas of the partition we are going to work on, and left and right arrows to select which command to run. So first I want to delete the partitions on /dev/sdc until it says nothing but free space. Then highlight the "free space" and select "new" and hit enter 3 times to go with the defaults, primary and max size available. Then go right to "write" and hit enter, and confirm it saving.
Format the new drive
Now we must format the drive so it's prepared for new files, to do this we use a variant of the mkfs command, thankfully fedora has a useful scripts for doing this with minimal options. Just make sure to replace /dev/sdc1 with the drive you were using because it will wipe the drive. You can also use ext3 but for the example I am using ext4, it really makes very little difference.
|mkfs.ext4 -j /dev/sdc1|
Backup the current fstab
|cp /etc/fstab ~/fstab.backup|
Make a dummy fstab
This is going to copy fstab to our homedir and then we're going to output the block id's into the dummy fstab, which saves us a bunch of copying and pasting and troubles with mistyping the block id's later.
| cp /etc/fstab ~|
blkid >> ~/fstab
You should have something like this now, take note I already have a drive1, and I am currently adding drive2, so you won't have that, but it's good for the example.
Edit the dummy fstab
Now we're going to use the program nano, which is a console based text editor, you'll mainly be using the up,down,left and right arrows in this to get around.
First we want to cursor down untill we get to the /dev/sdxx lines near the bottom. Delete any lines that are drives already in the system. You might notice that the drive starting with /dev/sda1: UUID="566... is also up near the top as my /boot drive. So I'm going to move the cursor to this line and press CTRL+K to delete that entire line, and any other lines that are also in the above section. when I'm done it should look like this.
The last line is the new drive, now we're going to use the arrows, and basically copy the line to look just like the other lines by removing the /dev/sdxx at the start and the quote marks, which in the end should look like this.
You can copy and paste this line up higher and make this file "pretty" but for the purposes of this howto, I am just going to leave it as is because it really makes no difference where in this file the new drives are at. Press CTRL+X to exit and verify it saving.
Preview the file
Preview your fstab, and be very careful that everything is right, if it's not, just use the nano command from earlier to go back in and edit it. It is crucial this file is correct.
Once your satisfied, continue on.
Copy the dummy for use
Now we need to use the following command to delete the current fstab and replace it with the new one.
| rm /etc/fstab|
mv ~/fstab /etc/fstab
Make the empty folders
I already have a /var/hda/drives folder, so I didn't need to do this, but you may have to.
Now we make the individual drive folder or folders if we need multiple.
You are going to have to reboot to apply these changes. Then just goto your hda and add the new drive into the greyhole pool. If you get an error, it can stop your system from booting normally, so I again ask that you verify the file is written correctly.