owned this note
owned this note
Published
Linked with GitHub
# LSI SATA in Origin 350
## Physical Installation (Origin 350)
### The SATA Card
Originally I had the card in PCI-X slot 3 (counting from the bottom), with the USB card installed in slot 4. This led to me not getting a graphical PROM (and I didn't have a serial cable at the time), which I think meant that it was unhappy with the combination of USB card and SATA card.
The USB card is happy to run at 66 Mhz, but we want the SATA card to run at the full 100 MHz. I ended up moving the USB card to slot 2 directly above the IO9 board (sharing a bus with it), and putting the SATA card in slot 4 with slot 3 empty. I suspect I could put either an audio card or the dual-gigabit NIC in slot 3 just fine, but neither is important to me at the moment. This leads to this output from L1:
```
001c01-L1>pci
Bus Slot Stat Power Mode/Speed
--- ---- ------- ----- -----------
1 1 0x80 01 15W PCI 66MHz [io9]
1 2 0x00 03 none PCI 66MHz [the usb card]
2 1 0x00 0f none PCIX 100MHz [empty]
2 2 0x00 0c 7.5W PCIX 100MHz [SATA card]
```
### Drive location
Best place is to remove the DVD drive. Lots of space there for two SSDs side to side, and there's convenient 4-pin molex for power. Alternatively, behind the fan between the fan and the PCI slots there is lots of space. You'll need to find a way to actually secure a SSD to this area; the back of the PCI cage is floating, so could secure something to that.
Cable routing in this area is easy; there is lots of room around the fan and the rest of the cards.
### Power
You have a 4-pin molex female connector coming into the drive bay area. If you remove the DVD drive, you also have a 4-pin floppy style small connector.
The cleanest option for a single drive is a 4-pin floppy to SATA power (e.g. https://www.amazon.com/luosh-Floppy-15-Pin-Converter-Adapter/dp/B08GKQ6V8R/). Otherwise, you'll need need to go from a 4-pin molex female connector to a 4-pin molex female (to plug into the SCSI backplane, where the original cable went), and to at least one SATA power connector. Length etc. are going to depend on where you decided to mount your drives.
### SATA cable
If you mount in the DVD spot or in the drive bay, you'll want > 30" to have some slack.
## Formatting
Only fx under IRIX can talk to the SATA controller -- standalone fx doesn't know how to do it. You'll need a scsi drive to boot from (and start an installation to). I suggest partitioning your boot drive as a "usrroot" drive in fx, as that will set up the small root partition for you (expand it to a few GB if you can just in case) automatically.
To partition the SATA drive, one option is to just start an install and drop into a shell from inst (admin > shell) and do it there. Then just keep going with the install.
Running fx:
Make sure you run with `-x`, we'll want to do some manual partition munging.
```
# hinv
...
Integral SCSI controller 3: Version SAS/SATA LS1064
Disk drive: unit 0 on SCSI controller 3
...
# fx -x 'dksc(3,0)'
fx version 6.5, Jul 1, 2005
...opening dksc(3,0,0)
...drive selftest...OK
Scsi drive type == ATA Samsung SSD 850 2B6Q
----- please choose one (? for help, .. to quit this menu)-----
[exi]t [d]ebug/ [l]abel/ [a]uto
[b]adblock/ [exe]rcise/ [r]epartition/
fx> r
----- partitions-----
part type blocks Megabytes (base+size)
8: volhdr 0 + 4096 0 + 2
10: volume 0 + 976773168 0 + 476940
capacity is 976773168 blocks
----- please choose one (? for help, .. to quit this menu)-----
[ro]otdrive [o]ptiondrive [e]xpert
[u]srrootdrive [re]size
```
Starting with usrroot creates the partitions that I care about;
I want swap as well. I'll get rid of the root partition later.
```
fx/repartition> u
fx/repartition/usrrootdrive: type of data partition = (xfs)
Warning: you will need to re-install all software and restore user data
from backups after changing the partition layout. Changing partitions
will cause all data on the drive to be lost. Be sure you have the drive
backed up if it contains any user data. Continue? yes
----- partitions-----
part type blocks Megabytes (base+size)
0: xfs 266240 + 102400 130 + 50
1: raw 4096 + 262144 2 + 128
6: xfs 368640 + 976404528 180 + 476760
8: volhdr 0 + 4096 0 + 2
10: volume 0 + 976773168 0 + 476940
capacity is 976773168 blocks
----- please choose one (? for help, .. to quit this menu)-----
[ro]otdrive [o]ptiondrive [e]xpert
[u]srrootdrive [re]size
```
Now we manually go and set the partition sizes to more useful values. Enter expert mode.
```
fx/repartition> e
Enter .. when done
```
Partition 0 is nominally the root partition. I can just get rid of it. Just resize it to 0/0 to delete it.
NOTE: Maybe I should have kept it, because I think a netboot set up could be made to boot the kernel which would then be able to mount the root partition. Either way, with my setup below I make an 8GB swap partition and I can always eat some of that.
```
fx/repartition/expert: change partition = (0)
before: type xfs block 266240, 130 MB
len: 102400 blks, 50 MB
fx/repartition/expert: partition type = (xfs)
fx/repartition/expert: base in megabytes = (130) 0
fx/repartition/expert: size in megabytes (max 476940) = (50) 0
after: type xfs block 0, 0 MB
len: 0 blks, 0 MB
```
Partition 1 is nominally swap. Make that a good size (8GB). Note base of 2MB.
```
fx/repartition/expert: change partition = (1) 1
before: type raw block 4096, 2 MB
len: 262144 blks, 128 MB
fx/repartition/expert: partition type = (raw)
fx/repartition/expert: base in megabytes = (2) 2
fx/repartition/expert: size in megabytes (max 476938) = (128) 8192
after: type raw block 4096, 2 MB
len: 16777216 blks, 8192 MB
```
Partition 6 is nominally usr. Use up the rest of the disk. Note base of 2 + swap_size MB.
```
fx/repartition/expert: change partition = (6)
before: type xfs block 368640, 180 MB
len: 976404528 blks, 476760 MB
fx/repartition/expert: partition type = (xfs)
fx/repartition/expert: base in megabytes = (180) 8194
fx/repartition/expert: size in megabytes (max 468746) = (468746)
after: type xfs block 16781312, 8194 MB
len: 959991856 blks, 468746 MB
```
Don't touch the rest, just keep pressing enter.
```
fx/repartition/expert: change partition = (7)
before: type xfs block 0, 0 MB
len: 0 blks, 0 MB
fx/repartition/expert: partition type = (xfs)
fx/repartition/expert: base in megabytes = (0)
fx/repartition/expert: size in megabytes (max 476940) = (0)
after: type xfs block 0, 0 MB
len: 0 blks, 0 MB
fx/repartition/expert: change partition = (8)
before: type volhdr block 0, 0 MB
len: 4096 blks, 2 MB
fx/repartition/expert: partition type = (volhdr)
fx/repartition/expert: base in megabytes = (0)
fx/repartition/expert: size in megabytes (max 476940) = (2)
----- partitions-----
part type blocks Megabytes (base+size)
1: raw 4096 + 16777216 2 + 8192
6: xfs 16781312 + 959991856 8194 + 468746
8: volhdr 0 + 4096 0 + 2
10: volume 0 + 976773168 0 + 476940
capacity is 976773168 blocks
```
And we're done!
```
----- please choose one (? for help, .. to quit this menu)-----
[ro]otdrive [o]ptiondrive [e]xpert
[u]srrootdrive [re]size
fx/repartition> ..
----- please choose one (? for help, .. to quit this menu)-----
[exi]t [d]ebug/ [l]abel/ [a]uto
[b]adblock/ [exe]rcise/ [r]epartition/
fx> exi
```
## Installation
I did a clean install on this. If you already have a /usr partition somewhere, you should be able to just `xfsdump` / `xfsrestore` and just swap the fstab entry.
### Set up in inst
Use the admin menu to unmount /root/usr and mount your new SATA partition in its place. You should be able to use fx in the shell to create the SATA partition if need be (fx, followed my `mkfs -t xfs`).
```
Inst> 13
Administrative Commands Menu
Admin> mount
/dev/miniroot on / type xfs (rw)
/proc on /proc type proc (rw)
/hw on /hw type hwgfs (rw)
/dev/dsk/realroot on /root type xfs (mrquota,rw)
/hw on /root/hw type hwgfs (rw)
/dev/usr on /root/usr type xfs (rw,raw=/dev/rusr)
Admin> sh
tezro# ls /dev/dsk
dks0d1s0 dks0d1s6 dks3d0s1 dks3d0vol root usr
dks0d1s1 dks0d1vol dks3d0s6 realroot swap
tezro# exit
Admin> umount /root/usr
Calculating sizes .. 100% Done.
Admin> mount /dev/dsk/dks3d0s6 /root/usr
Calculating sizes .. 100% Done.
Admin> mount
/dev/miniroot on / type xfs (rw)
/proc on /proc type proc (rw)
/hw on /hw type hwgfs (rw)
/dev/dsk/realroot on /root type xfs (mrquota,rw)
/hw on /root/hw type hwgfs (rw)
/dev/dsk/dks3d0s6 on /root/usr type xfs (rw)
```
Then install as usual. At the very end, after you exit, enter a shell before you reboot. (Forgot to save the transcript of this)
Edit /root/etc/mount and change /usr to be /dev/dsk/dks3d0s6. You'll have to be creative -- vi didn't work for me (no termcap entry), I ended up just doing:
```
tezro# cat > /root/etc/mount
/dev/root / xfs rw,raw=/dev/rroot 0 0
/dev/dsk/dks3d0s6 /usr xfs rw,raw=/dev/rdsk/dks3d0s6 0 0
^D
```
## Other Notes
### Copying one XFS filesystem to another:
Here's copying a root partition (`s0`) to another, can use the same with /usr
`xfsdump -l 0 -J -p 5 - /dev/dsk/dks0d1s0 | xfsrestore - /mnt/other-root`
### Root filesystem notes
1. Netscape is a pig and installs 150MB in `/var/netscape`. Move this to ``/usr/var`:
```
# cd /var
# mv netscape /usr/var
# ln -s /usr/var/netscape .
```
2. `lp` keeps a bunch of PPDs in `/var/spool/lp`. Move this entire thing to `/usr/var/spool/lp`:
```
# cd /var/spool
# mkdir -p /usr/var/spool
# chkconfig lp off ### if on, doesn't hurt
# mv lp /usr/var/spool/lp
```
This should get you down to ~100 MB root filesystem. There's a few other things in there -- e.g. 13MB of appletalk junk, 16MB of `sgi_apache`.
### Net booting (remove spinning rust)
It's possible to netboot fully, as long as you have a bootp server that's willing to send over the kernel. Booting in this way seems to remove the ability to use loadable modules with the kernel, but I'm not sure if that's relevant anyway.
The kernel accepts a `root=foo` argument to specify the root device; in order to use a PCI card, you have to use the full hwgraph path. For example:
```
boot -f bootp():boot/unix showconfig=1 root=/hw/module/001c01/Ibrick/xtalk/14/pci/2/scsi_ctlr/0/target/0/lun/0/disk/partition/0/block
```
`showconfig=1` is also useful as it gives some more verbose info during boot.
In the normal boot process, `sash` is loaded, and then `sash` (which understands XFS and other filesystems), loads `unix`. This comes from the following env variables:
```
SystemPartition=dksc(0,1,8)
OSLoader=sash
OSLoadPartition=dksc(0,1,0)
OSLoadFilename=unix
```
With these settings, and without a physical drive, you'll see an error that looks like:
```
Starting up the system...
Unable to execute dksc(0,1,8)/sash: no such device
Unable to load bootfile: no such device
Unable to boot; press any key to continue:
```
Because we're booting from the network, we don't need to go through sash. So, let's fix this!
```
>> setenv netaddr 192.168.20.100
>> setenv netmask 255.255.255.0
>> setenv SystemPartition bootp()
>> setenv OSLoadPartition bootp()
>> setenv OSLoader boot/unix
>> setenv OSLoadFilename boot/unix
>> setenv root "/hw/module/001c01/Ibrick/xtalk/14/pci/2/scsi_ctlr/0/target/0/lun/0/disk/partition/0/block"
>> setenv OSLoadOptions "showconfig=1"
```
You'll need a copy of `unix` from your system partition available via bootp() as `boot/unix` (use whatever filename makes sense for you). This is often easiest to get during the initial `inst`, if you can `rcp` it somewhere else.
(See the IRIX Admin manual https://irix7.com/techpubs/007-2859-017.pdf for more info)