Ubuntu 8.10 is certainly causing a stir on the Internet with a host of mixed responses out there..
Call it cheesy, but I am willing to put up with a few newly-introduced bugbears for the sake of being able to play tunes out of Rhythmbox and hear the sound of Look Around You playing on YouTube at the same time. Hardy Heron barfed at me when I attempted to mix Flash audio with Gnome-application audio and I very frustratingly had to log out then back in again just to get the sound back.
Current Ubuntu 8.10 issues:
- Ubiquity (Ubuntu Installation application) could not detect my obscure partition table - neither could the Alternate CD - I had to use the GUI Update Manager to carry out an upgrade rather than a preferred fresh build
- screen-resolution-extra interferes with manual configuration (Xorg.conf) combined with xrandr not playing nicely with the closed-source ATI driver
The problem with these issues is that they appear to be introduced with Intrepid and I do expect this to be a teething release of Ubuntu, however, it is still fun to be the guinea pig.
My prime suspect for the funky partition setup that is currently my 320GB hard drive is the Hardy auto-magic repartitioning at install time. The system works fine and dual boots between Ubuntu and Vista fine, but the lack of support I have from Ubiquity (and parted, and gparted, and cfdisk..) has come back again to bite me on the bum. I want to do cool things..
Like converting my Vista setup to a VMWare virtual machine and “hosting” it within Ubuntu so I never need to boot into anything else. VMWare Converter is free and VMWare Player is free (and I have dabbled in things-VMWare before). Quick and easy is the name of the game when it comes to this solution - I’d love to try KVM over VMWare but until they provide a rock-solid free P2V (Physical to Virtual) app for Windows, I’m happy with this solution.
I plugged in a 300GB external IDE hard drive and attempted to kick off the P2V job for the Vista setup. I would point the finger at the USB2 transfer rate being the culprit of being far too slow to convert a 35GB partition into a virtual disk - try 7 hours. What to do now? I need some local disk to take advantage of those sweet 3Gb/s SATAII transfer rates. Being so supportive of Ubuntu, I gave my Ubuntu install almost all of my disk and I now need to carve off 50GB for a temporary virtual disk staging area (somewhere to save my Vista virtual machine to).
I get all scared when I have to start tinkering around with online file partition resizing, so I opted to use the user-friendly gparted. However, gparted like all of the other partition resizing apps told me to go jump because my partition table was funky. I confirmed this in parted:
naaman@perkynana:~$ sudo parted /dev/sda
GNU Parted 1.8.9
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: Can't have overlapping partitions.
naaman@perkynana:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 240G 41G 187G 18% /
tmpfs 1.8G 0 1.8G 0% /lib/init/rw
varrun 1.8G 112K 1.8G 1% /var/run
varlock 1.8G 0 1.8G 0% /var/lock
udev 1.8G 2.9M 1.8G 1% /dev
tmpfs 1.8G 332K 1.8G 1% /dev/shm
lrm 1.8G 2.0M 1.8G 1% /lib/modules/2.6.27-7-generic/volatile
/dev/sdb1 147G 91M 147G 1% /media/Emancipatee
Next angle of attack was to shrink the filesystem if resize2fs was happy with the way things were, it was..
(”resize2fs -P /dev/device” simply prints the minimum size of a filesystem that it can shrink to)
naaman@perkynana:~$ sudo resize2fs -P /dev/sda6
resize2fs 1.41.3 (12-Oct-2008)
Estimated minimum size of the filesystem: 10719416
The method of shrinking an ext3 filesystem is to shrink it first with resize2fs then trim down the partition size in fdisk. Being the only partitioning tool that was playing along, I hopped into fdisk to print out some important numbers (partition cylinder boundaries) just in case things got a little messy..
naaman@perkynana:~$ sudo fdisk /dev/sda
The number of cylinders for this disk is set to 38913.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): p
Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x18000000
Device Boot Start End Blocks Id System
/dev/sda1 * 38587 38914 2620416 c W95 FAT32 (LBA)
/dev/sda2 11 1316 10485760 7 HPFS/NTFS
/dev/sda3 * 1316 5754 35648437+ 7 HPFS/NTFS
/dev/sda4 5755 38914 266350820+ f W95 Ext'd (LBA)
/dev/sda5 38587 38914 2620416 dd Unknown
/dev/sda6 5755 37263 253096011 83 Linux
/dev/sda7 37264 38586 10626966 82 Linux swap / Solaris
Partition table entries are not in disk order
Command (m for help): x
Expert command (m for help): p
Disk /dev/sda: 255 heads, 63 sectors, 38913 cylinders
Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID
1 80 0 1 1023 254 63 1023 619898880 5240832 0c
2 00 18 9 10 254 63 1023 161792 20971520 07
3 80 254 63 1023 254 63 1023 21133312 71296875 07
4 00 254 63 1023 254 63 1023 92438071 532701641 0f
5 00 254 63 1023 254 63 1023 527460809 5240832 dd
6 00 254 63 1023 254 63 1023 1 506192022 83
7 00 254 63 1023 254 63 1023 63 21253932 82
I need to boot off a Live CD for this one..
naaman@perkynana:~$ sudo resize2fs -p /dev/sda6 200G
resize2fs 1.41.3 (12-Oct-2008)
Filesystem at /dev/sda6 is mounted on /; on-line resizing required
On-line shrinking from 63274002 to 52428800 not supported.
Now a retry from the Live CD (turned out I only had a beta release of Feisty Fawn at hand), I had to do a filesystem check prior to the resize:
ubuntu@ubuntu:~$ sudo e2fsck -f /dev/sda6
e2fsck 1.40-WIP (14-Nov-2006)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda6: 168923/15818752 files (4.5% non-contiguous), 11136293/63274002 blocks
ubuntu@ubuntu:~$ sudo resize2fs -p /dev/sda6 200G
resize2fs 1.40-WIP (14-Nov-2006)
Resizing the filesystem on /dev/sda6 to 52428800 (4k) blocks.
Begin pass 2 (max = 300838)
Relocating blocks XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 3 (max = 1931)
Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 4 (max = 18241)
Updating inode references XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The filesystem on /dev/sda6 is now 52428800 blocks long.
The next step was to shrink the size of the /dev/sda6 partition after I shrank the filesystem on top of it. After RTFM’ing about fdisk, I was under the impression that because cfdisk wouldn’t work with my obscure partition table, sfdisk was the next best choice for this task. I foobarred the sizing of the partition 2 or 3 times before I managed to shrink it enough to fit the Vista virtual disk onto the new space. I got the sizing incorrect however after every attempt I always booted back into Ubuntu and tested that my Ubuntu installation was still working super-A1-100%.
With sfdisk, I simply had to specify the start cylinder of the partition (which should not be changed in this exercise) and the new size in cylinders. Here’s my maths on how why I chose the sizes I did:
10845202 blocks freed (by resize2fs command) = 5.83% of current sda6
current sda6 cylinders = 31509
5% of current sda6 = 1575.45
new sda6 cylinder size = 30000
For some strange reason, I ended up lowering the cylinder size of sda6 to 26500 because 30000 was only giving me roughly 10GB when I needed a lot more. Prior to running the sfdisk command, it is a good idea to go into System -> Preferences -> Removable Media and turn off automatic mounting of removable media as it automatically mounts the disk you want to play with when you run sfdisk.
I ran sfdisk only on the /dev/sda6 (indicated by -N6) and I also created a backup of any disk sectors that were changed by specifying the -O option - the sda-partition-sectors.save file could have then been used to restore back to the original state using sfdisk -I sda-partition-sectors.save (see the manpage for more info).
ubuntu@ubuntu:/media/excon$ sudo sfdisk /dev/sda -N6 -O sda-partition-sectors.save
Checking that no-one is using this disk right now ...
OK
Disk /dev/sda: 38913 cylinders, 255 heads, 63 sectors/track
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 38586+ 38913- 327- 2620416 c W95 FAT32 (LBA)
start: (c,h,s) expected (1023,254,63) found (1023,0,1)
/dev/sda2 10+ 1315- 1306- 10485760 7 HPFS/NTFS
/dev/sda3 * 1315+ 5753- 4439- 35648437+ 7 HPFS/NTFS
/dev/sda4 5754+ 38913- 33160- 266350820+ f W95 Ext'd (LBA)
/dev/sda5 38586+ 38913- 327- 2620416 dd Unknown
/dev/sda6 5754+ 37262 31509- 253096011 83 Linux
/dev/sda7 37263+ 38585 1323- 10626966 82 Linux swap / Solaris
Input in the following format; absent fields get a default value.
<start> <size> <type [E,S,L,X,hex]> <bootable [-,*]> <c,h,s> <c,h,s>
Usually you only need to specify <start> and <size> (and perhaps <type>).
/dev/sda6 :5754 30000
/dev/sda6 5754+ 35753 30000- 240974968+ 83 Linux
New situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 38586+ 38913- 327- 2620416 c W95 FAT32 (LBA)
start: (c,h,s) expected (1023,254,63) found (1023,0,1)
/dev/sda2 10+ 1315- 1306- 10485760 7 HPFS/NTFS
/dev/sda3 * 1315+ 5753- 4439- 35648437+ 7 HPFS/NTFS
/dev/sda4 5754+ 38913- 33160- 266350820+ f W95 Ext'd (LBA)
/dev/sda5 38586+ 38913- 327- 2620416 dd Unknown
/dev/sda6 5754+ 35753 30000- 240974968+ 83 Linux
/dev/sda7 37263+ 38585 1323- 10626966 82 Linux swap / Solaris
Warning: partitions 1 and 5 overlap
I don't like this - probably you should answer No
Do you want to write this to disk? [ynq] y
Successfully wrote the new partition table
Re-reading the partition table ...
If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
After shrinking /dev/sda6, I had enough space to create a new partition between /dev/sda6 and /dev/sda7 as follows (fdisk was clever enough to provide sensible defaults):
ubuntu@ubuntu:/media/excon$ sudo fdisk /dev/sda
The number of cylinders for this disk is set to 38913.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): n
First cylinder (35755-38914, default 35755):
Using default value 35755
Last cylinder or +size or +sizeM or +sizeK (35755-37263, default 37263):
Using default value 37263
Command (m for help): t
Partition number (1-8): 8
Hex code (type L to list codes): 7
Changed system type of partition 8 to 7 (HPFS/NTFS)
Command (m for help): p
Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 38587 38914 2620416 c W95 FAT32 (LBA)
/dev/sda2 11 1316 10485760 7 HPFS/NTFS
/dev/sda3 * 1316 5754 35648437+ 7 HPFS/NTFS
/dev/sda4 5755 38914 266350820+ f W95 Ext'd (LBA)
/dev/sda5 38587 38914 2620416 dd Unknown
/dev/sda6 5755 35754 240974968+ 83 Linux
/dev/sda7 37264 38586 10626966 82 Linux swap / Solaris
/dev/sda8 35755 37263 12121011 7 HPFS/NTFS
Partition table entries are not in disk order
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Following multiple re-shrinkings (if that’s a word) of /dev/sda6, I managed to get the right size to perform the P2V of my Vista install.
My current problem is that VMWare Player tries to boot Vista whilst cooking my machine..

(left to right - Hard Disk Temp, CPU Temp, Graphics Processor Temp, Overall Temp)
I’ll have to work on that..
Update:
sudo cpulimit --limit 70 -e vmware-vmx
Does the trick nicely by limiting the vmware-vmx process to 70% of the CPU - CPU temp is currently hovering around the sane region of 50 degrees Celcius.
Also, check out this link to get the keys working properly within VMWare Player on Ubuntu Intrepid Ibex.