6. Preparing your harddisk for installation

Contents of this section

Ok, it's up for the most dangerous part of the installation - partitioning your harddrive. You might probably skip this step if you still have a few reserved/unused partitions on your harddisk. Otherwise, you will have to say good-bye to some (at least 1) of your AmigaOS partitions, back it up and use it for Linux.

6.1 How many partitions do I need ? How big should they be ?

It depends. You will at least need a root partition. Although it is not usual, you can make this one quite large and thus save the /usr partition. But one idea behind the partitioning scheme is that it might be desirable to mount /usr read-only. This will certainly not work if your root and usr filesystems are on the same partition (e.g. /tmp is used for a lot of temporary files, and /var/ generally contains files that vary in size).

Furthermore, you should allocate space for a swap partition. If you have enough main memory (say, 8 MB and above) and do not intend to run X11, you could live without a swap partition for a while, but at least X11 sort of requires a swap partition. Alternatively you could work with a swap file on one of the "ordinary" partitions, but swapping to a file is slower (having to access it through the filesystem code) than swapping to a partition (with direct access to each block on that partition).

Apart from these 2(3) vital filesystems, you might add more, according to your needs. Here is Frank's current setup, including the sizes of the partitions (1 block is 1 KByte).

Filesystem         1024-blocks  Used Available Capacity Mounted on
/dev/sda9              10762    9154     1070     90%   /
/dev/sda8              72467   53845    14999     78%   /usr
/dev/sda10              4290    1520     2770     35%   /temp
/dev/sda7             131073  117845     6663     95%   /usr2
/dev/sdb1               6254    6254        0    100%   /ados/sys
/dev/sdb2             102070  102070        0    100%   /ados/dh1
/dev/sdb3              61773   61773        0    100%   /ados/dh2
/dev/sdb4              10620   10620        0    100%   /ados/temp
/dev/sdb5              23423   23423        0    100%   /ados/tmp2
/dev/sda1             205205  205205        0    100%   /ados/fdh0
/dev/sda3             109060  109060        0    100%   /ados/fdh1
/dev/sda6             103320  103320        0    100%   /ados/fdh4
/dev/sda4             205205  187447     7498     96%   /mnt3
/dev/sda5             103320   93093     5061     95%   /mnt4

The /, /usr, /usr2, /mnt3 and /mnt4 partitions contain ext2 filesystems. /temp is an MS-DOS filesystem that I use for exchanging files with AmigaOS (installing this is described below). It is possible to transfer files via floppy discs, but that is a tad bit slow.

All other partitions under /ados are my Amiga FastFilesystem partitions. I need them regularly under Linux (although they cannot be written to from Linux at the moment), so I mount them automatically on startup.

You could also use Ralf Baechle's minix-handler. It allows to read directly files from Linux partitions under AmigaOS (you can also write files to Linux partitions, but this is a bit risky - see below). However, as the name implies, this handler only works with filesystems of the type minix. You might say 'ok, so why not use a large root partition of type minix then', but minix filesystems have several disadvantages over ext2 filesystems, the most important being the limitations of filenames to 14 characters (on ext2, it's 255 characters). So, whenever I need to access files from AmigaOS, I copy them to /temp first, reboot and read them under AmigaOS using the CrossDOSFilesystem. Please read subsection Transferring files between AmigaOS and Linux below; it gives details on preparing an MS-DOS partition on both sides.

The above filesystem list does not show a swap partition because it is not mounted like an ordinary partition. Its size is (in my case) 16 MB, and it is located on /dev/sda11. A rule of thumb is to have a swap space twice your memory size.

In older versions of Linux, the size of a single swap partition was limited to 16 MB, but that limit is gone by now. Right now, swap partitions have to be at least 40 KB and at most 131 MB in size. This should be enough for most situations.

So, how big should you make your partitions ? In a few words:

These are only rough numbers; if you stick to them, it doesn't mean you will never have to repartition your system again. You might suddenly find you want to set up your machine for mail & news software, and by then you will probably require a lot more disk space. Your mileage may vary.

6.2 Setting partition sizes

So, the real nasty part: Setting the partition sizes. This paragraph is hardware-dependant; we assume you use the standard Commodore program for harddisk partitioning, HDToolbox. We do not know if users of other SCSI host adapter boards (like the GVP series II, which is already supported) have problems with this - we cannot test this. Your harddisk partitioning software should at least be able to write the partitioning data into the RDB (rigid disk block) correctly because this is the place from where Linux/m68k gets its information about the disk structure.

If you are uncertain about this, try the following: Start the kernel with a ramdisk filesystem (see A first check ), and check the output of kernel messages. Somewhere it should say something like:


Partition check:

The following lines list all harddisks and partitions Linux has discovered when starting. The first entry in each column is the harddisk as a whole, and after that you should see just as much device names as that harddisk as partitions (if your sda disk had 5 partitions, the partition check should list sda1..sda5). The output would then be:


Partition check:
  sda: sda1 sda2 sda3 sda4 sda5

Ok, once again before we come to the core of it: Unless you are using an entire harddisk solely for Linux, make a backup of everything. Even if you use a dedicated harddisk only for Linux, it is a good idea to make a backup, because you might still mix up the device names and make the mistake of mkfs'ing (read that as: formatting) the wrong partition/harddisk.

Start HDToolbox. You should be familiar with the use of this program from your AmigaOS manuals.

In HDToolBox, click on the drive you want to use for Linux, then click on [Change drive type], then [Define new drive type], [Read configuration from drive]. Now the drive parameters should be displayed in the window. Don't wonder if these values look a bit strange, for example Ingo's Quantum drives report:

LPS 540: 1 head, 500 blocks per track, 500 blocks per cylinder
LPS 105: 1 head, 98 blocks per track, 98 blocks per cylinder
(This is because the drives hide their real parameters from the system.)

Write down the number of blocks per cylinder. Now go back to the list of drives and click on [Partition drive]. Activate [Advanced options] to see the total number of cylinders for the partitions. Now create the partitions you want/need. Remember the number of the partition (the leftmost partition on the bar is partition 1, the next partition 2 and so on). For each of the Linux partitions, click on [Change filesystem for partition], then select [Reserved partition] and set Automount to "no". This is to avoid seeing the Linux partitions as funny icons under AmigaOS. They would only cost you memory for buffers, so why should you automount them?

Finally, write down the block sizes (in KB!) of the Linux partitions. These are calculated as:

<Blocks_per_Cylinder> * <Total_Num_Cylinders> / 2

For example, I have four Linux partitions on my Quantum 105 (98 blocks per cyl):


Part. 1 and 2: 252 cylinders each, for a total block size of 12348 each
Part. 3      : 127 cylinders, for a total block size of 6223
Part. 4      : 1464 cylinders, for a total block size of 71736

Click OK to go back to the list of drives, then select Save changes to drive.

WARNING: THIS WILL DESTROY ALL DATA ON THE CHANGED PARTITIONS! DOUBLE-CHECK THAT EVERYTHING IS CORRECT!!!

6.3 Starting the kernel

Now you are going to boot up Linux with a RAM filesystem (what you probably already did in the "First test" section above). To achieve that, do the following - if you have not already done it: Copy the kernel image to a directory on a partition where you have at least about 2 MB space left, and unpack it - you will need gzip for that:


cd <path_where_kernel_is>
gzip -d vmlinux-<x.y>.gz

Alternatively, you might want to use another kernel that is slightly smaller because it does not contain Atari specific stuff. It should be available on

ftp.informatik.uni-oldenburg.de .

At the time of writing this the version was 0.9.12; I will upload "Amiga" versions of the current kernel there every then and now).

Also, copy the bootstrap program and the RAM filesystem image to the same place and unpack them. Both should already be on your harddisk from the first test.

Now, to start the kernel, type what you already did in the first check:


amiboot-<x.y> -k vmlinux-<version> -r new-filesys video=pal,inverse

You might have to add other options, like wd33c93=... to disable sync negotiation for some SCSI devices, or possibly use a different video mode. See A first check .

If you have CD-ROMs or other SCSI equipment in your computer, don't miss to read two paragraphs in the FAQ:

8.9 My SCSI bus locks up when I want to use my DAT drive

and

8.11 My SCSI bus locks up when the kernel probes for devices

(We did tell you to read all of this document first, and then install Linux, right ? ;-)

Also, if you need to access your CD-ROM / other external SCSI devices under Linux, it is necessary that these devices are already switched on when you start the kernel. There's no way of telling the kernel there is a CD-ROM (or any other external SCSI device - tape streamer, Syquest..) in your system if it hasn't found it by itself when it probes for connected devices at startup time.

After a few seconds, the screen should become black and the kernel should come up with a lot of messages. If this is not the case, check everything again (read the "A first check" section again).

In the boot message, Linux reports the drives and partitions found. In Ingo's case, it looks like this (don't mix this up with Frank's partition table as seen above) :

    [...]
    Calibrating delay loop.. ok - 6.12 BogoMips
    scsi0 : Commodore A2091/A590 SCSI
    scsi : 1 hosts.
      Vendor: QUANTUM   Model: LPS540S           Rev: 590S
      Type:   Direct-Access                      ANSI SCSI revision: 02
    Detected scsi disk sda at scsi0, id 0, lun 0
      Vendor: TOSHIBA   Model: CD-ROM XM-3401TA  Rev: 3593
      Type:   CD-ROM                             ANSI SCSI revision: 02
    Detected scsi CD-ROM sr0 at scsi0, id 3, lun 0
      Vendor: QUANTUM   Model: LP105S 910109405  Rev: 2.8
      Type:   Direct-Access                      ANSI SCSI revision: 02
    Detected scsi disk sdb at scsi0, id 5, lun 0
    scsi : detected 2 SCSI disks 0 tapes 1 CD-ROM drive total.
    [...]
    Linux/68k version 0.9.4 (root@tori) #1 11/29/94
    Partition check:
      sda: sda1 sda2 sda3 sda4
      sdb: sdb1 sdb2 sdb3 sdb4
    [...]

The Quantum 540 is the first harddisk (SCSI id 0), which makes it device sda for Linux. The Quantum 105 is the second harddisk (SCSI id 5), this makes it device sdb (note that the 105 is not the second SCSI device in the chain - that's a Toshiba CDROM drive at SCSI id 3. But what's important is that it's the second harddisk). A third harddisk would be sdc and so on.

If you are using this on an Amiga with an IDE controller, like an A4000, the partition names start with hd instead of sd. Apart from that, the naming scheme is the same for SCSI and IDE.

From the boot message we can see that Linux correctly identified the four partitions on my Quantum 105. sdb is the entire disk, sdb1 the first partition, sdb2 the second and so on.


Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter