| 1 |
These are sources and binaries for a Linux/Alpha boot file installer |
| 2 |
and disk partitioner. They're horrible, and should be destroyed. |
| 3 |
We're going to assume you don't have OSF/1, but want to use your hard |
| 4 |
drive. If you have OSF/1, what are you doing in here??!?!?!!? |
| 5 |
|
| 6 |
The program also assumes you have a SCSI disk with 512-byte sectors, |
| 7 |
tho it should work fine on an IDE drive as well. All sizes are |
| 8 |
specified on the command line in sectors. |
| 9 |
|
| 10 |
There are 8 partitions in total, and are numbered from 0 to 7. |
| 11 |
Partitions have to be added sequentially, as this program won't let |
| 12 |
you leave empty partitions unlike many BSD disklabel programs. |
| 13 |
|
| 14 |
First off, if you have an invalid disk label (you've never run this |
| 15 |
program before) you get to do |
| 16 |
|
| 17 |
sdisklabel /dev/sda zero |
| 18 |
|
| 19 |
(/dev/sda is the device you're partitioning, substitute as |
| 20 |
appropriate). |
| 21 |
|
| 22 |
This zeros out your disk label. Only do this if you really want to |
| 23 |
zero your disk label. It just does it; it doesn't ask, or warn, or |
| 24 |
anything. |
| 25 |
|
| 26 |
The program also probably printed out the size of your disk in K. If |
| 27 |
it was wrong, you now get to use the "size xxx" option along with the |
| 28 |
rest of these commands. The size isn't critical, it's just used to try |
| 29 |
and make sure you don't go past the end of the disk. |
| 30 |
|
| 31 |
Next, add your first partition. This *doesn't* start from 0, as you |
| 32 |
have to leave room for the boot loader and other stuff. 256K (or 512 |
| 33 |
sectors) will be enough. |
| 34 |
|
| 35 |
Let's pretend that you want to make a 250000K partition starting |
| 36 |
from sector offset 512: |
| 37 |
|
| 38 |
sdisklabel /dev/sda 0 512 500000 8 print |
| 39 |
|
| 40 |
The last number is the filesystem type, and is currently 8 for ext2fs |
| 41 |
filesystems. (A different number would be used to specify an OSF/1 |
| 42 |
partition, for example). |
| 43 |
|
| 44 |
If all was successful, the program should print out the partition (the |
| 45 |
last keyword, "print", specifies that it should print the partition |
| 46 |
after modifying it with the previous command), and you should see |
| 47 |
something like |
| 48 |
---------------------------------------------------------------- |
| 49 |
I think your disk is 528870K total size. |
| 50 |
If I'm wrong, override the size with the 'size num' option |
| 51 |
|
| 52 |
partition 0: type 8, starts sector 512, size 500000 |
| 53 |
---------------------------------------------------------------- |
| 54 |
|
| 55 |
We can then add the next partition, which would be partition 1. |
| 56 |
To add a second partition that is 200000K long, we'd run |
| 57 |
sdisklabel /dev/sda 1 512256 400000 8 print |
| 58 |
And both partitions would then be printed out. |
| 59 |
|
| 60 |
If for some reason the size got determined incorrectly, we'd do |
| 61 |
instead |
| 62 |
|
| 63 |
sdisklabel /dev/sda size 528870 0 512 400000 8 print |
| 64 |
|
| 65 |
The size option should come immediately after the device name, and the |
| 66 |
size is the total # of sectors on the drive. |
| 67 |
|
| 68 |
That wasn't too bad, was it? The program doesn't do enough error |
| 69 |
checking, but it should work OK if you don't try to abuse it. |
| 70 |
|
| 71 |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 72 |
|
| 73 |
Adding a bootstrap to the HD |
| 74 |
|
| 75 |
This isn't exactly trivial, and should be done immediately after |
| 76 |
setting up the partitions (but not before...). I can't be held |
| 77 |
responsible if the bootstrap writer wipes your drive-it does hardly |
| 78 |
any error checking, tho it tries to make sure that you're not going to |
| 79 |
wipe out any partitions before it starts writing. |
| 80 |
|
| 81 |
The program basically writes a raw binary image (*not* an a.out format file) |
| 82 |
to the disk starting from sector 2. This can be generated from an executable |
| 83 |
by using the arch/alpha/linux/tools/build program found in the kernel |
| 84 |
distribution, or the similar program in the aboot distributiion. So to |
| 85 |
install the bootloader in bootlx, assuming you've partitioned your disk (and |
| 86 |
left enough blank space between the start of the disk and the first |
| 87 |
partition to hold the bootloader): |
| 88 |
|
| 89 |
swriteboot /dev/sda bootlx |
| 90 |
|
| 91 |
When using aboot, you can also append a kernel image by using |
| 92 |
|
| 93 |
swriteboot /dev/sda bootlx vmlinux.gz |
| 94 |
|
| 95 |
If you invoke swriteboot with the '-v' option, it will be a bit more |
| 96 |
verbose. |
| 97 |
|
| 98 |
If you have to partition your disk with a program that does not allow to |
| 99 |
leave a blank (unpartitiones) space at the beginning for the bootloader, |
| 100 |
create a partition of the desired size instead. swriteboot will complain |
| 101 |
that the desired boot area overlaps with that partition, so you must use |
| 102 |
|
| 103 |
swriteboot -f# ... |
| 104 |
|
| 105 |
where # is the partition number to force overwriting this area. |