Talk:Copying disks with Linux

From Try-AS/400
Jump to navigation Jump to search

Description of a disk copy run

Me and PoC managed to successfully recover MULIC data from a running system (the model 200 here) and restore it onto new DASD. As you knew, I had a functional Italian install on 2x2GB DASD, and 2x4GB DASD (formatted/used by PowerPC AS) ready for it.

I first tried to copy the 2GB DASD onto the 4GB DASD. This resulted in a machine that got stuck in early SLIC IPL, but that got past MULIC IPL – it did a main storage dump right after the C6004004 SRC (and it managed to complete said dump). Based on the documentation, I suspect that this is the first SRC after reassembling the LIDs into RAM and right after enabling full paging, suggesting this failure means that it couldn’t find the boot device (but did manage to load SLIC into RAM).

So, to preserve MULIC using a Linux machine, connect the DASD to a Linux machine and use the following command:

$ sg_dd blk_sgio=1 bs=520 if=/dev/sg1 of=disk1_bs520.dd verbose=2 sync=1 -p

Make sure to use an appropriate output file name (of=) and set the correct input device (if=). For me, sg0 was the disk the Linux machine booted from. Make sure to do this with all disks, and preserve these files. Feel free to compress them using eg gzip.

Once you have the original DASD imaged, you need to prepare the new ones. They need to be either the same size as the original ones or larger. This hasn’t been tested with smaller disks, but since MULIC lives at the beginning of the disk, this could also work with eg smaller DASD.

To prepare a new disk, you have to format it in the right block size. You do this using:

$ sg_format -v -v -6 --format --size=520 /dev/sg1

Again, /dev/sg1 is the new DASD you’ve connected to the linux box. Once it’s reformatted as 520 bytes per sector, reboot the Linux machine. This is the easiest way to make sure the old formatting didn’t get stuck in a cache somewhere.

Once you’ve done that, write back the image of the original (smaller) DASD to the replacement one:

$ sg_dd blk_sgio=1 bs=520 of=/dev/sg1 if=disk1_bs520.dd verbose=2 sync=1 -p

Here, again, check to make sure you’re using the right target disk. The blk_sgio=1 parameter is important here, since it tells sg_dd to bypass the Linux block device driver and use raw SCSI CDBs to interface with the disk. If you don’t do this, it won’t write the data. Give the resulting disk the same ID as the one you got the image from, put it in the correct slot. Repeat this for all the disks you’ve imaged.

Once this is done, reassemble, and IPL using a B-M mode. This will fail, but it’s important to make sure that it fails after it reaches the very early C600 SRCs. If you get this far, SLIC and MULIC got restored correctly, but SLIC is not in a functional state. This is fine.

Once you get here, IPL from a distribution tape with a D-M IPL, and use CP option 24 once it asks for it (SRC A6nn 6001 – select the utility you want to run). This will throw an error, SRC A6nn 6002 – Load Source Disk Already contains data. Again, this is what you want, because this means you’ve primed the disk with the old disk’s contents correctly. Confirm by keying 24 in again on the control panel.

Now the waiting game begins, and it’ll reinstall SLIC onto the new disks. Once complete, it’ll reIPL, and you’ll be greeted with the usual screen where you can enter SST, IPL or install the operating system. If you get here, you should have successfully replaced the DASD with newer DASD, retained the MULIC and avoided the need for a MULIC tape.

-- Friedkiwi