My FREESCO page | Installing a large second drive

Installing a large second drive

This page was written after 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. The page was written with FREESCO 032 in mind, but the process is generic enough to be valid for any FREESCO version.

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
My email

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 is 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

[ Top ]


Last modified: Tue Apr 8 10:02:19 CEST 2008

Valid HTML 4.01!