Monday, December 14, 2009

How to move OpenSolaris onto another (smaller?) disk:

How to move OpenSolaris onto another (smaller?) disk:
(assuming original disk is on c8t0d0):

fdisk -B /dev/rdsk/c8t1d0p0
[format c8t1d0 with one slice s1]
zpool create -f newpool /dev/dsk/c8t1d0s0
zfs set canmount=noauto newpool
zfs create -o mountpoint=legacy -o canmount=off newpool/ROOT
zfs create -o mountpoint=/ -o canmount=noauto newpool/ROOT/opensolaris
zfs snapshot rpool/ROOT/opensolaris@now
zfs send rpool/ROOT/opensolaris@now | zfs receive -F newpool/ROOT/opensolaris
zfs destroy -r rpool/ROOT/opensolaris@now
zfs mount rpool
zfs mount newpool
cp -rp /rpool/. /newpool
vi /newpool/boot/grub/menu.lst
rm /newpool/boot/grub/bootsign/pool_rpool
touch /newpool/boot/grub/bootsign/pool_newpool
echo pool_newpool > /newpool/etc/bootsign
zfs umount rpool
zfs umount newpool
installgrub -m -f /boot/grub/stage[12] /dev/rdsk/c8t1d0s0
init 6

(Then delete the original zfs devices):
swap -d /dev/zvol/dsk/rpool/swap
zfs destroy rpool/swap

(Recreate /export etc)
zfs create -p newpool/export/home/admin
zfs set mountpoint=newpool/export
zfs set mountpoint=legacy rpool/export/home/admin
mount -F zfs rpool/export/home/admin /mnt
cd /mnt
find . -print | cpio -dumpv /export/home/admin
cd /
umount /mnt
zfs destroy -r rpool/export

(create new swap device)
zfs create -V 512M newpool/swap
swap -a /dev/zvol/dsk/newpool/swap
swap -d /dev/zvol/dsk/rpool/swap
zfs destroy rpool/swap
[vi /etc/vfstab, and edit swap device]

(create new dump device)
zfs create -o volblocksize=128k -V 512M newpool/dump
dumpadm -d /dev/zvol/dsk/newpool/dump
zfs destroy rpool/dump

(rename old root pool)
zpool export rpool
zpool import rpool oldpool
mv /oldpool/boot/grub/bootsign/pool_rpool /oldpool/boot/grub/bootsign/pool_oldpool
echo "pool_oldpool" > /oldpool/etc/bootsign
[vi /oldpool/boot/grub/menu.lst]
umount /oldpool

(boot off old root pool to be able to rename new root pool back to "rpool"):

Saturday, March 28, 2009

20090328 - Windows Vista - leaner than Windows 7?

Following on from my tests earlier, here's a Vista Enterprise 512MB machine freshly installed with 512MB memory, and no paging file:



babelfish:~ crispi$ ps -e -o pid,rss,command | grep -i vmx | grep -v grep
8821 697112 /Library/Application Support/VMware Fusion/vmware-vmx -E en -D krof3I/KOq0DLgAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= -# product=1;name=VMware Fusion;version=2.0.2;buildnumber=146107;licensename=VMware Fusion for Mac OS;licenseversion=6.0 build-146107; -@ pipe=/var/folders/7R/7Rq7evMGH9qZLSXoCGYx6k+++TI/-Tmp-//vmware-crispi/vmx998c9980be2dd6b0;readyEvent=25 /Users/crispi/vmware/Vista.vmwarevm/Vista.vmx

Remember we were comparing this with Windows 7:

12607 706252 /Library/Application Support/VMware Fusion/vmware-vmx -E en -D mJw7K7usuM8LJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= -# product=1;name=VMware Fusion;version=2.0.2;buildnumber=146107;licensename=VMware Fusion for Mac OS;licenseversion=6.0 build-146107; -@ pipe=/var/folders/7R/7Rq7evMGH9qZLSXoCGYx6k+++TI/-Tmp-//vmware-crispi/vmxc6654b5eff7f6b21;readyEvent=27 /Users/crispi/vmware/Windows7.vmwarevm/Windows7.vmx


Conclusion? Don't believe all the hype. Windows 7 does not appear to use less memory than Vista.

Wednesday, March 25, 2009

20090325 - Download updated RPMs for CentOS - even without Centos installed

(Install the Bare essentials in /test)
(Mount Disk1/DVD):


[root@MELLIDPOC99 ~]# mount /dev/cdrom /mnt
[root@MELLIDPOC99 ~]# mkdir /test

(Install 3 RPMs) :
[root@MELLIDPOC99 ~]# rpm -r /test --nodeps --noscripts -ivh /mnt/CentOS/basesystem-8.0-5.1.1.el5.centos.noarch.rpm
warning: /mnt/CentOS/basesystem-8.0-5.1.1.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:basesystem ########################################### [100%]

[root@MELLIDPOC99 ~]# rpm -r /test --nodeps --noscripts -ivh /mnt/CentOS/filesystem-2.4.0-1.el5.centos.x86_64.rpm
warning: /mnt/CentOS/filesystem-2.4.0-1.el5.centos.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:filesystem ########################################### [100%]

[root@MELLIDPOC99 ~]# rpm -r /test --nodeps --noscripts -ivh /mnt/CentOS/centos-release-5-2.el5.centos.x86_64.rpm
warning: /mnt/CentOS/centos-release-5-2.el5.centos.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:centos-release ########################################### [100%]


(Mount each CD in turn, or use the DVD):
[root@MELLIDPOC99 ~]# mount /dev/cdrom /mnt
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@MELLIDPOC99 ~]# for rpm in /mnt/CentOS/*.rpm; do rpm -r /test -ivh --nodeps --ignorearch --force --justdb --quiet --nosignature $rpm 2> /dev/null ; done
[root@MELLIDPOC99 ~]# umount /mnt

(May need to set up a proxy (especially if in a NTLM environment))
:
[root@MELLIDPOC99 ~]# export http_proxy=http://melwiscap02.global.thenational.com:5865
[root@MELLIDPOC99 ~]# export https_proxy=${http_proxy}
[root@MELLIDPOC99 ~]# yum install yum-downloadonly
base 100% |=========================| 1.1 kB 00:00
primary.xml.gz 100% |=========================| 1.1 MB 00:05
base : ################################################## 3223/3223
updates 100% |=========================| 951 B 00:00
primary.xml.gz 100% |=========================| 434 kB 00:02
updates : ################################################## 959/959
addons 100% |=========================| 951 B 00:00
primary.xml.gz 100% |=========================| 157 B 00:00
extras 100% |=========================| 1.1 kB 00:00
primary.xml.gz 100% |=========================| 98 kB 00:00
extras : ################################################## 266/266
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package yum-downloadonly.noarch 0:1.1.10-9.el5.centos set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
yum-downloadonly noarch 1.1.10-9.el5.centos base 9.0 k

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 9.0 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): yum-downloadonly-1 100% |=========================| 9.0 kB 00:00
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897
Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) " from http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: yum-downloadonly ######################### [1/1]

Installed: yum-downloadonly.noarch 0:1.1.10-9.el5.centos
Complete!

(Create a destination for the RPMs):
[root@MELLIDPOC99 ~]# mkdir /test/updates

(Grab away):

[root@MELLIDPOC99 /]# yum -q -y --installroot=/test --downloaddir=/test/updates --downloadonly update
exiting because --downloadonly specified

[root@MELLIDPOC99 /]# ls -1 /test/updates/ | head -20
avahi-0.6.16-1.el5_2.1.i386.rpm
avahi-0.6.16-1.el5_2.1.x86_64.rpm
avahi-glib-0.6.16-1.el5_2.1.i386.rpm
avahi-glib-0.6.16-1.el5_2.1.x86_64.rpm
bind-libs-9.3.4-6.0.3.P1.el5_2.i386.rpm
bind-libs-9.3.4-6.0.3.P1.el5_2.x86_64.rpm
bind-utils-9.3.4-6.0.3.P1.el5_2.x86_64.rpm
bluez-libs-3.7-1.1.i386.rpm
bluez-libs-3.7-1.1.x86_64.rpm
bluez-utils-3.7-2.2.el5.centos.x86_64.rpm
bzip2-1.0.3-4.el5_2.x86_64.rpm
bzip2-libs-1.0.3-4.el5_2.i386.rpm
bzip2-libs-1.0.3-4.el5_2.x86_64.rpm
cups-1.2.4-11.18.el5_2.3.x86_64.rpm
cups-libs-1.2.4-11.18.el5_2.3.i386.rpm
cups-libs-1.2.4-11.18.el5_2.3.x86_64.rpm
dbus-1.0.0-7.el5_2.1.i386.rpm
dbus-1.0.0-7.el5_2.1.x86_64.rpm
dbus-x11-1.0.0-7.el5_2.1.x86_64.rpm
dhcpv6-client-1.0.10-4.el5_2.3.x86_64.rpm

Also, can also do just this to get all the RPMs from a base distribution:

[root@MELLIDPOC99 /]# yum -y --installroot=/test --downloaddir=/test/updates --downloadonly groupinstall Base

Monday, February 23, 2009

20090223 - Windows XP vs Windows 7

More memory tests - with no paging file enabled:

Windows XP SP3 vs Windows 7.

Summary : Windows 7 Ultimate Beta uses 200MB more memory than Windows XP Professional SP2:




Even with best performance and classic features (no background image), the stats are about the same:

Friday, February 20, 2009

20090220 - Well, is Windows Genuine or not

Immediately after rebooting windows:





Oh - apparently we were genuine after all...

Saturday, February 14, 2009

Windows 7 vs Ubuntu 8.10 (32 bit versions)

Test Scenario:

Install each OS in a VMware Fusion Guest.
Set virtual memory to 512MB.
Set swap file size in each OS to zero.
Install VMware tools for each OS.
Set the graphics display to fullscreen.
Install all OS updates from the vendor.
reboot each OS and login.
Wait 5 minutes for each OS to complete starting background services.
Observe memory consumed from within and outside the OS:

Results:

PS output (2nd column shows kilobytes resident for each vmx process for each OS)

babelfish:~ crispi$ ps -e -o pid,rss,command | grep -i vmx | grep -v grep
babelfish:~ crispi$ ps -e -o pid,rss,command | grep -i vmx | grep -v grep
12567 478432 /Library/Application Support/VMware Fusion/vmware-vmx -E en -D mJw7K7usuM8LJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= -# product=1;name=VMware Fusion;version=2.0.2;buildnumber=146107;licensename=VMware Fusion for Mac OS;licenseversion=6.0 build-146107; -@ pipe=/var/folders/7R/7Rq7evMGH9qZLSXoCGYx6k+++TI/-Tmp-//vmware-crispi/vmxe012108b06b26cd4;readyEvent=28 /Users/crispi/vmware/Ubuntu 8.10.vmwarevm/Ubuntu 8.10.vmx
12607 706252 /Library/Application Support/VMware Fusion/vmware-vmx -E en -D mJw7K7usuM8LJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= -# product=1;name=VMware Fusion;version=2.0.2;buildnumber=146107;licensename=VMware Fusion for Mac OS;licenseversion=6.0 build-146107; -@ pipe=/var/folders/7R/7Rq7evMGH9qZLSXoCGYx6k+++TI/-Tmp-//vmware-crispi/vmxc6654b5eff7f6b21;readyEvent=27 /Users/crispi/vmware/Windows7.vmwarevm/Windows7.vmx


From within each OS:

Ubuntu 8.10 = 148 MB
Windows 7 = 427 MB

Screen snapshots below (taken from outside the VM):


Conclusion

Windows 7 takes up 279MB more memory than Ubuntu. This is not insubstantial for low end netbook machines.

Thursday, January 29, 2009

20090129 - CPUID differences

Interestingly, found that VMware Workstation 6.0 masks the CPUID and stepping differently from the native processor, but VMware WS6.5 corrects this.

eg:

Native:

VMware workstation 6.0:
VMware workstation 6.5:
Compare this with VirtualBox 2.1.0:

VirtualBox: