Adding a second drive or partion

If you need some help, this should be the first place to look.

Postby Lightning » Mon Apr 28, 2003 12:52 am

The first thing to know is what do the drive devices refere to.

/dev/hda1 primary drive on primary controller

/dev/hda2 second partion on primary drive. Although it does not have to be hda2 and in most cases it will actually be hda5. There can be multiple partions on a single drive. But the default dev directory only supports up to hd?5. This reference is only listed once. But it pertains to all drives and the only difference will be the third character hd?.

/dev/hdb1 second drive on primary controller.
/dev/hdc1 primary drive on secondary controller.
/dev/hdd1 secondary drive on secondary controller.

There can be other devices defined. But these are the defaults that are in FREESCO 03x. FREESCO 027 only has hda1, hda5, hdb1, hdb5

To mount a file system. You need to know what type of file system you are running. Options are

vfat: DOS/Windows which can include long file names.

umsdos: This is what FREESCO is using and is able to keep long file names as well as user/directory permissions.

iso9660: Data CDrom's use this format.

ext2: Linux file format. Using this format is the best solution. But it requires that the drive is formatted using tools availible as a package for FREESCO, or by using an older lib5 Linux version. Drives formatted with new linux systems will not be usable in FREESCO, because of inode density.

There are others. But for this article those are the ones of concern. Linux needs a directory to mount a drive. This is a primary concideration, before you start. The directory should be empty, although not required. Unless files are in use.

So here is a simple demo of how to mount the second drive on the primary controller. For this demo it is determined that the drive will be used for downloads in the www directory and the drive is formatted with DOS to start with.

Code: Select all
mkdir /www/downloads
mount -t vfat /dev/hdc1 /www/downloads
:> /www/downloads/--linux-.---
umount /www/downloads

The above commands make a vfat drive usable as umsdos. You then should add your mount commands to the start section of the rc_user file. So that the drive is mounted automaticly at each boot. If the drive is formatted with ext2. Then the above is not needed.

edit /rc/rc_user
Code: Select all
    mount -t umsdos /dev/hdc1 /www/downloads

rc_user start

Postby dingetje » Mon Apr 28, 2003 7:16 am

Good one!
For the sake of completeness, the command to mount an ext2 file system would be:

Code: Select all
 ? mount -t ext2 /dev/hdc1 /www/downloads

Where hdc1 is the device name and /www/downloads is the mount point. Change that to match your situation.
If the disk is very large, the mount process can take some time, specially if it wasn't dismounted properly due to a system crash or power failure. A workaround for that is to run the mount in background like so:

Code: Select all
 ? fork mount -t ext2 /dev/hdc1 /www/downloads

<span style='color:red'>Only</span> do this if none of the other commands in rc_user require file access to that partition!

The tools to create and maintain an ext2 file system are available as a 3rd party add-on package for both 027 and 03x. The package is based on the <a href='' target='_blank'>e2fsprogs</a> tools. For an introduction to the ext2 file system, look <a href='' target='_blank'>here</a>.

<a href='' target='_blank'>Here</a> is a tutorial about disk partitioning using linux tools. And <a href='' target='_blank'>here</a> is another.

I've used the e2fsprogs tools to partition and format a new 10G second harddisk on my 027 box without using any windoze or DOS tools. Just hooked up the new disk, installed e2fsprogs and followed one of the many online tutorials.

Postby dingetje » Mon Mar 01, 2004 7:15 am

effo has written an excellent howto for adding a harddisk using the e2fsprogs tools.

His page can be found <a href='' target='_blank'>here</a> and is mirrored <a href='' target='_blank'>here</a>

"Software is like sex: it's better when it's free." - LINUS TORVALDS
User avatar
Posts: 1010
Joined: Wed Nov 14, 2001 12:13 pm
Location: The Netherlands

Postby Lightning » Wed Mar 23, 2005 1:28 am

As suggested in another thread. It is important to know that if you mount another partition or drive in FREESCO it is recommended that you also un mount the drive before FREESCO shuts down or reboots. The /rc/rc_user "stop" section is a one choice for this kind of action so that it is done automatically. But depending on what the partition is used for that may not work and may require being put into the /etc/rc_stop script and copied to /boot/etc/
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Return to FAQ - Frequently Asked Questions

Who is online

Users browsing this forum: No registered users and 2 guests