/* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma ident "@(#)README.create_diskimage 1.1 05/03/14 SMI" ########## ## Creating a valid Legion disk image ## ## Mon Mar 7 09:33:44 PST 2005 ## ## Steps for creating a disk image for simulation use. You ## will need to ensure that the amount of disk space used ## in your root filesystem is small enough for the disk ## you are creating (or the disk is large enough for the ## root partition you are cloning).. ## ## tycho.nightingale@sun.com, michael.ogorman@sun.com ## ########## # mkfile -n 512m file # lofiadm -a file # newfs /dev/rlofi/1 # installboot sun4v_bootblk /dev/rlofi/1 # mount /dev/lofi/1 /mnt # cd /mnt # ufsdump 0f - / | ufsrestore xf - . # cd / # umount /mnt # fsck -y /dev/rlofi/1 # lofiadm -d /dev/rlofi/1 # make_valid_disk_label file || teach_legion_about_creating_labels ## Currently, legion needs a valid disk label on your disk image. ## It will then overwrite this with the new values for the slices ## you specify in your legion conf file and it creates a valid ## s2 size to represent the entire disk. ## ## This needs to be fixed so that legion can create the entire ## label on it's own, regardless of what's in the first 512 ## byte block of the disk ## ## Until this is done, you need to add a label to a disk image ## as follows: ################### # dd if=/dev/rdsk/c0t1d0s0 of=./label.dd bs=1b count=1 conv=sync # dd if=./label.dd of=./disk.image bs=1b count=1 conv=notrunc ## ## To make a disk bootable under legion you will ## need the following config changes: ## note: $BIN is a reference to /home/mo23723/workspace/snapshots/disks/bin # lofiadm -a file # mount /dev/lofi/1 /mnt - Add [hsimd "SUNW,legion-disk"] to /mnt/etc/driver_aliases - Add [hsimd 246] to /mnt/etc/name_to_major (ensure number not already in use) - Add hsimd driver as follows: # cp $BIN/hsimd /mnt/platform/sun4v/kernel/drv/sparcv9/hsimd # cd /mnt; cpio -icdB < $BIN/devices.cpio XXX Show list of devicesto create XXX # cp $BIN/vfstab /mnt/etc/vfstab - remove root passwd - comment out smf startup line in /etc/inittab