Diego Righi
2006-Oct-05 23:42 UTC
[qemu-discuss] Silly experiment: solaris software-lvm-raid1-root-boot setup inside qemu
I just said "why not?" it actually worked like a charm, 64bit host and guest :) 1) Install nevada booting qemu like this (solaris.img is a 4gb image): # /opt/SUNWqemu/64/bin/qemu-system-x86_64 -m 512 -vnc 0 -net nic,model=rtl8139 -net user -boot d -cdrom sol-nv-b48-x86-dvd.iso solaris.img select the "dhcp" networking option and partition like this (do a user install): c0d0s0 swap 256m c0d0s1 /metadb1 42m c0d0s3 / 3600m c0d0s4 /metadb2 42m 2) Run nevada in qemu like this (mirror.img is another 4gb image): # /opt/SUNWqemu/64/bin/qemu-system-x86_64 -m 512 -vnc 0 -net nic,model=rtl8139 -net user -redir tcp:2222:10.0.2.15:22 -hdc mirror.img solaris.img (optional but faster when in qemu) when you have rebooted, take the guest with vnc, select command line login, and then: # svcadm disable cde-printinfo # svcadm disable cde-calendar-manager # svcadm disable cde-login # svcadm disable wbem # svcadm disable autofs # svcadm disable volfs # svcadm disable sendmail then create a user or enable ssh root login, and login via ssh pointing to the 2222 port of the host machine. 3) Login via ssh, become root, comment out the metadb entries in /etc/vfstab like this: #/dev/dsk/c0d0s1 /dev/rdsk/c0d0s1 /metadb1 ufs 2 yes - #/dev/dsk/c0d0s4 /dev/rdsk/c0d0s4 /metadb2 ufs 2 yes - and unmount them like this: # umount /metadb1 # umount /metadb2 # rm -rf /metadb* 4) Copy the partition table of the first disk on the second one: # prtvtoc /dev/rdsk/c0d0s2 | fmthard -s - /dev/rdsk/c1d0s2 (check with format->partition the partitions/slices, they have to be the SAME) 5) Create the metadb databases on both disks: # metadb -af -c 2 /dev/dsk/c0d0s1 /dev/dsk/c0d0s4 # metadb -af -c 2 /dev/dsk/c1d0s1 /dev/dsk/c1d0s4 6) Concat the slices: # metainit -f d10 1 1 /dev/dsk/c0d0s0 # metainit -f d20 1 1 /dev/dsk/c1d0s0 # metainit -f d11 1 1 /dev/dsk/c0d0s3 # metainit -f d21 1 1 /dev/dsk/c1d0s3 # metainit d0 -m d10 # metainit d1 -m d11 7) Setup your root set in vfstab: # metaroot d1 8) now you should see this in place of the old root mouting line: # grep md /etc/vfstab /dev/md/dsk/d1 /dev/md/rdsk/d1 / ufs 1 no - (it is adviced to add the "nologging" option in place of the last "-") and you can manually change the swap to go on raid too: #/dev/dsk/c0d0s0 - - swap - no - /dev/md/dsk/d0 - - swap - no - 9) Reboot. # shutdown -y -g0 -i6 10) Make the second disk bootable too: # installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1d0s0 11) Attach the slices of the second disk: # metattach d0 d20 # metattach d1 d21 12) Look the sync status: # metastat 13) How your guest system should look like: # df -h |grep md /dev/md/dsk/d1 3.6G 2.5G 1.0G 72% / # mount |grep md / on /dev/md/dsk/d1 read/write/setuid/devices/intr/largefiles/logging/xattr/onerror=panic/dev=1540005 on Thu Oct 5 23:20:02 2006 14) How your host directory will look like: $ pwd /home/sickness/qemu/solaris $ ls -lh total 14858452 -rw-r--r-- 1 sickness other 137 Oct 5 18:19 installsolaris.sh -rw-r--r-- 1 sickness other 3.9G Oct 6 01:35 mirror.img -rw-r--r-- 1 sickness other 144 Oct 5 18:17 runsolaris.sh -rw-r--r-- 1 sickness other 3.2G Oct 6 01:35 solaris.img (the bigger size of the mirror image file, is probably due to the way qemu images are being compressed...) tnx to these 2 really useful and clear pages: http://www.zazzybob.com/svm_raid1.html http://ashtech.net/~syntax/blog/archives/50-Solaris-10-Partitioning,-RAID,-and-ZFS.html -- This message posted from opensolaris.org