| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Nov | ||||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | 31 | ||
Posted on November 10th, 2008 by naaman.
Categories: ubuntu, vmware, vmware converter, vmware player, fdisk, sfdisk, intrepid ibex, intrepid.
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:
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.
Posted on December 30th, 2007 by naaman.
Categories: gigs, php, ajax, curl, lineup.meard.org.
Announcing the alpha release of lineup.meard.org..
At present the calendar is not functional and there are other creases that require ironing however the AJAX search for artists and venues along with the search itself is fully functional..
More thorough details of lineup.meard.org will be posted on tech.meard.org in the near future.
Comments on this site are highly appreciated as all feedback will be evaluated. If private contact is needed regarding the site, I can be reached at: naaman –AT– meard ..DOT.. org.
Posted on December 16th, 2007 by naaman.
Categories: snes9x, snes9express, tv out, nvidia.
After having another attempt at a SNES (Super Nintendo Entertainment System) emulator setup, I decided to locate a game controller to make the effort worth it. A few searches of Static Ice and Shop Bot helped me find my AUD$9 Foxconn controller at Computer Alliance. I also decided to buy an S-VIDEO cable to give Linux TV-Out another go as well after failing to get anywhere with my older Toshiba laptop over the last few years. Newer laptop (HP Pavillion dv5129tx) and a newer OS (Ubuntu Gutsy Gibbon) might work out for me..
Side note: If your laptop has a 7-pin S-VIDEO port it will support a 4-pin cable, the 7-pin carries extra component signals
When I got home, I smelt the “new car” smell of the controller, plugged it in and ran a
tail /var/log/syslog
Here’s what appeared:
Dec 16 12:27:25 freddo kernel: [ 7222.496000] usb 4-2: USB disconnect, address 2 Dec 16 12:27:28 freddo kernel: [ 7225.604000] usb 4-2: new low speed USB device using uhci_hcd and address 3 Dec 16 12:27:28 freddo kernel: [ 7225.784000] usb 4-2: configuration #1 chosen from 1 choice Dec 16 12:27:28 freddo kernel: [ 7225.808000] input: DragonRise Inc. Generic USB Joystick as /class/input/input7 Dec 16 12:27:28 freddo kernel: [ 7225.808000] input: USB HID v1.10 Joystick [DragonRise Inc. Generic USB Joystick ] on usb-0000:00:1d.2-2 Dec 16 12:27:28 freddo kernel: [ 7225.876000] usbcore: registered new interface driver xpad Dec 16 12:27:28 freddo kernel: [ 7225.876000] /build/buildd/linux-source-2.6.22-2.6.22/drivers/input/joystick/xpad.c: driver for Xbox controllers v0.1.6
After having a look at System -> Preferences -> Hardware Information, I saw the device was listed in there, however the device file that was listed against the controller wasn’t the right one I needed to put into snes9express - the device path is /dev/input/js0. When I started snes9express and mapped the keys to the right buttons for a SNES controller, snes9x would bomb out because of a dodgy argument that was being passed to the program. The mapping (and the joystick device path) should be set in the snes9x config file - /etc/snes9x/snes9x.conf - here’s some portions of mine:
[Unix]
EnableJoystick = TRUE
Joydev1 = /dev/input/js0
Joydev2 = (null)
Joydev3 = (null)
Joydev4 = (null)
SoundBufferSize = 0
IncFormat = %03d # Use one printf-style integer conversion, optionally with
# the '0' flag and a field width
[Unix/X11]
Interpolate = 0
Scale = FALSE
SetKeyRepeat = FALSE
DGAModeSwitch = FALSE
StartFullscreen = FALSE
[Unix/SVGA Controls]
J00:Axis0 = Joypad1 Axis Left/Right T=50%
J00:Axis1 = Joypad1 Axis Up/Down T=50%
J00:B0 = Joypad1 X
J00:B1 = Joypad1 A
J00:B2 = Joypad1 B
J00:B3 = Joypad1 Y
J00:B6 = Joypad1 L
J00:B7 = Joypad1 R
J00:B8 = Joypad1 Select
J00:B11 = Joypad1 StartHow did I get the right buttons mapped to the right SNES buttons? I apt-getted joystick which contains the useful program called jstest which is the equivalent of xev for joysticks when run as follows:
jstest --event /dev/input/js0
I ran the jstest command whilst looking at a pic of a SNES controller and having vi open /etc/snes9x/snes9x.conf.
The other settings I changed in the config file include:
I came across a strange occurrence when I started snes9express for the first time, it kept asking for osnes9x instead of snes9x, a quick ln -s /usr/bin/snes9x ~/temp/osnes9x fixed it by putting “/home/naaman/temp/osnes9x” into the snes9x path in the Preferences -> Paths tab. The problem seemed to go away when I had set the “Start-Up loads …” option to “Last run options” in the Preferences -> Reset tab.
The last issue I had with snes9express was the choppy, jumpy sound. The sound issue was fixed by increasing the Rate to 5 (29300 Hz) instead of the default 4. The sound can be fixed using the “-r 5″ argument on the command line for snes9x as well if a frontend like snes9express isn’t being used.
Moving onto the TV-Out adventure. I am using a relic of the early eighties that my flatmate had “collected” on a kerbside collection day and placed on the back deck. Luckily this beast has a SCART port and stereo sound (better than my “good” TV). I bought a SCART to S-VIDEO/RCA adapter a few weeks ago for a party we hosted so we could watch HDTV on it :). Using nvidia-settings, the very well-written app detected the TV on a rescan and I had a picture that needed some serious V-Hold action (for those not accustomed to V-Hold, the picture was constantly “rolling”).
Thanks to the excellent howto on Ubuntu Forums, I managed to make a backup of my /etc/X11/xorg.conf then edit it to look like this:
Section "Monitor"
# HorizSync source: edid, VertRefresh source: edid
Identifier "Monitor0"
VendorName "Unknown"
ModelName "LPL"
HorizSync 30.0 - 75.0
VertRefresh 60.0
Option "DPMS"
EndSection
Section "Monitor"
# HorizSync source: builtin, VertRefresh source: builtin
Identifier "Monitor1"
VendorName "Unknown"
ModelName "TV-0"
HorizSync 28.0 - 33.0
VertRefresh 43.0 - 72.0
EndSection
Section "Device"
Identifier "Videocard0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce Go 7400"
BusID "PCI:1:0:0"
Screen 0
EndSection
Section "Device"
Identifier "Videocard1"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce Go 7400"
Option "TVOutFormat" "SVIDEO"
Option "TVStandard" "PAL-G"
Option "ConnectedMonitor" "Monitor1"
BusID "PCI:1:0:0"
Screen 1
EndSection
Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor0"
DefaultDepth 24
Option "TwinView" "0"
Option "metamodes" "DFP: nvidia-auto-select +0+0"
SubSection "Display"
Depth 24
EndSubSection
EndSection
Section "Screen"
# Removed Option "metamodes" "TV: 640x480 +0+0"
Identifier "Screen1"
Device "Videocard1"
Monitor "Monitor1"
DefaultDepth 24
Option "TwinView" "0"
Option "metamodes" "TV: nvidia-auto-select +0+0"
SubSection "Display"
Depth 24
EndSubSection
EndSectionAfter a few restarts of the X-server and a long hour of testing, I was reliving some good old memories of the SNES on my back deck.. Hmmn, I wonder what I’m going to get Dad for Christmas..
