Installing a large second drive

The latest version of this article can be found at http://bakskuru.se/fredrik/freesco/

Yesterday I finally had a go on installing a 60GB drive into my Freesco 032. I had some worries about this, but it ran rather smooth thanks to the forums. I thought it might be a good idea to write the process down. Who knows, maybe it can help some other newbie. I wrote this with 032 in mind, but the process is generic enough to be valid for both FREESCO versions (027 and 032).

All cred should go to the original posters.

I welcome any critic, tips and comments. However, I do not have the possibility to answer any questions.

//Fredrik

BIOS

My Freesco-box is an old 120MHz with BIOS from 1996 or something like that. I realised that BIOS wouldn't recognize my new HD correct so I started looking for a solution. My first idea was to use Maxtors MaxBlast as disk overlay and hope that would help. While browsing the forums I found a post from BHN2 saying “Freesco is like all good Linuxes, Freesco does not care about the bios limits. So your computer may only see the drive as a 8GB, but Freesco will see the full size.”. If that was correct, it was good news. Even if BIOS only see a rather small drive, Freesco would recognize its full size.

Selecting filesystem

I found Lightning's FAQ posting on how to add a second drive. Here he states that ext2 is the best file system to choose. Dingetje follows up with some good ideas on how to create an ext2 system and includes some very good links. From this, I decided to have a go on ext2, hence I downloaded and installed the e2fs package.

I installed the drive as master on the second IDE channel, rebooted the machine and took a look in BIOS. It recognized the drive as a 2.1 GB drive and booted ok.

Partitioning the drive

I found out that the first drive on the second channel is called /dev/hdc and started fdisk to partition it:

fdisk /dev/hdc

I decided to split the drive into four primary partitions, each about 15Gb. Creating the partitions was rather straightforward and when done I had four new partitions like this:

Device Boot Start End Blocks Id System
/dev/hdc1 1 1913 15366141 83 Linux native
/dev/hdc2 1914 3826 15366172+ 83 Linux native
/dev/hdc3 3827 5739 15366172+ 83 Linux native
/dev/hdc4 5740 7297 12514635 83 Linux native

Formatting the partitions

I started formatting hdc1 with

mke2fs /dev/hdc1

Worked like a smack! Continuing with hdc2 this happened:

Could not stat /dev/hdc2 --- No such file or directory
The device apparently does not exist; did you specify it correctly?

As a total Linux newbie that made me real nervous. What was going on? I took a look in /dev and realized I only had hdc1 and hdc5 specified. This was obvious the reason why I couldn't format hdc2. Could this be fixed in any way? As always, the forums are the secret to success.

Adding devices

I realized I needed to create some new devices for hdc2-4 and this could be done with the command mknod. When creating a new device you have to know its name, its type, and its major and minor device number. Name is the easiest; we know it should be /dev/hdc2. According to the forums, the type should be set to b (for block). The meaning of the minor and major device number wasn't explained very well in the forums, even if there were several examples on how to do this:

mknod /dev/hdc b 22 0
mknod /dev/hdc1 b 22 1

I found out that 22 is the major device number for the second IDE channel so each device on that channel should have the major number set to 22. For each new device added, the minor number should be increased. So adding hdc2-4 was done with

mknod /dev/hdc2 b 22 2
mknod /dev/hdc3 b 22 3
mknod /dev/hdc4 b 22 4

If you want to see the major device number of all devices, type

ls -al /dev

The major and minor device number are displayed just before the date (separated with a comma).

When this had been done, formatting the partitions was no problem.

Mounting the devices

This was rather straight forward. I wanted to use the new space as up/download directories on my ftp server. I created the directories where the new partitions should be mounted and mounted them with

mount -t ext2 /dev/hdc1 /mnt/bootdev/router/pkg/home/ftp/upload/up1

Finally, I used df to check disk usage.

Making changes permanent

As pointed out by Lightning, these changes are lost when system is rebooted. To make them permanent, you have to add the mknod and mount commands to the boot) section of the file /rc/rc_user. You should also add commands for unmounting the drives when FREESCO is shutting down. This is best done in the stop) section of the file. Reboot your machine and check your new partitions.

Useful links

 
freesco/howtos/install_a_2nd_harddisk.txt (55539 views) · Last modified: 2005/09/14 00:49 (external edit)
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki