Thursday, May 24, 2012

Copying Thunderbird Mails and Address Book from Ubuntu 10.04 to 12.04

I am running Ubuntu 10.04 on my office Laptop since April 2010. When Ubuntu 12.04 came I considered distribution upgrade but decided not to do it since I was running latest versions of Libreofice, Thunderbird, Firefox using Launchpad PPAs. My only problem was to transfer the Mails and Address Book in Thunderbird. The other problem was to resize the big NTFS partition to install Ubuntu 12.04 on a new partition. I solved the NTFS resize problem as described on this post.

For copying Mails and Address Book I copied  xxxxxxxx.default folder and profiles.ini file from/to .thunderbird folder from Ubuntu 10.04 to 12.04 and it works perfectly.

Now I am using Ubuntu 12.04 on my office Laptop.

Tuesday, May 22, 2012

Resizing NTFS Partition using gparted and chkdsk

Today I installed Ubuntu 12.04 on a Laptop which had Windows XP and Ubuntu 10.04 in dual boot and large extended NTFS partition on E:/ drive. First I tried to resize the NTFS partition using gparted of Ubuntu 10.04 but it failed and also made the NTFS partition unmountable on Ubuntu. I corrected the partition using testdisk and it became mountable. Then I decided to try gparted on Ubuntu 12.04 and successfully resize the partition as follows:
I inserted the usb Startup disk into usb port of the Laptop and booted into Ubuntu 12.04. Clicked on top left icon called Dash Home and searched for gparted and clicked on the gparted icon. I right clicked on the NTFS partition and selected check. As expected the gparted produced following error:
GParted 0.11.0 --enable-libparted-dmraid
Libparted 2.3
Check and repair file system (ntfs) on /dev/sda5  00:00:07    ( ERROR )
    
calibrate /dev/sda5  00:00:00    ( SUCCESS )
    
path: /dev/sda5
start: 204,796,683
end: 623,032,829
size: 418,236,147 (199.43 GiB)
check file system on /dev/sda5 for errors and (if possible) fix them  00:00:07    ( ERROR )
    
ntfsresize -P -i -f -v /dev/sda5
    
ntfsresize v2012.1.15AR.1 (libntfs-3g)
Device name : /dev/sda5
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 214136902144 bytes (214137 MB)
Current device size: 214136907264 bytes (214137 MB)
Checking for bad sectors ...
Checking filesystem consistency ...
Accounting clusters ...
Cluster accounting failed at 12408217 (0xbd5599): extra cluster in $Bitmap
Cluster accounting failed at 12408218 (0xbd559a): extra cluster in $Bitmap
Cluster accounting failed at 12408219 (0xbd559b): extra cluster in $Bitmap


Filesystem check failed! Totally 2576 cluster accounting mismatches.
ERROR: NTFS is inconsistent. Run chkdsk /f on Windows then reboot it TWICE!
The usage of the /f parameter is very IMPORTANT! No modification was
and will be made to NTFS by this software until it gets repaired.


Then I rebooted into Windows XP and opened command prompt

>chkdsk E: /f
The type of the file system is NTFS.
CHKDSK is verifying files (stage 1 of 3)...
File verification completed.
CHKDSK is verifying indexes (stage 2 of 3)...
Index verification completed.
CHKDSK is verifying security descriptors (stage 3 of 3)...
Security descriptor verification completed.
CHKDSK discovered free space marked as allocated in the volume bitmap.
Windows has made corrections to the file system.
209118068 KB total disk space.
51761464 KB in 45713 files.
19896 KB in 7661 indexes.
0 KB in bad sectors.
131132 KB in use by the system.
65536 KB occupied by the log file.
157205576 KB available on disk.
4096 bytes in each allocation unit.
52279517 total allocation units on disk.
39301394 allocation units available on disk.

Then I  rebooted twice in Windows XP.

Once again I booted into Ubuntu 12.04 using usb startup disk and started gparted, right clicked on the partition and selected check. This time gparted reported as follows:
GParted 0.11.0 --enable-libparted-dmraid
Libparted 2.3
Check and repair file system (ntfs) on /dev/sda5    ( SUCCESS )
    
calibrate /dev/sda5  00:00:00    ( SUCCESS )
    
path: /dev/sda5
start: 204,796,683
end: 623,032,829
size: 418,236,147 (199.43 GiB)
check file system on /dev/sda5 for errors and (if possible) fix them    ( SUCCESS )
    
ntfsresize -P -i -f -v /dev/sda5
    
ntfsresize v2012.1.15AR.1 (libntfs-3g)
Device name : /dev/sda5
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 214136902144 bytes (214137 MB)
Current device size: 214136907264 bytes (214137 MB)
Checking for bad sectors ...
Checking filesystem consistency ...
Accounting clusters ...
Space in use : 53159 MB (24.8%)
Collecting resizing constraints ...
Estimating smallest shrunken size supported ...
File feature Last used at By inode
$MFT : 162676 MB 0
Multi-Record : 170638 MB 27119
$MFTMirr : 107604 MB 1
Compressed : 42052 MB 30556
Ordinary : 168508 MB 26979
You might resize at 53158412288 bytes or 53159 MB (freeing 160978 MB).
Please make a test run using both the -n and -s options before real resizing!
grow file system to fill the partition  00:00:00    ( SUCCESS )
    
run simulation  00:00:00    ( SUCCESS )
    
ntfsresize -P --force --force /dev/sda5 --no-action
    
ntfsresize v2012.1.15AR.1 (libntfs-3g)
Device name : /dev/sda5
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 214136902144 bytes (214137 MB)
Current device size: 214136907264 bytes (214137 MB)
New volume size : 214136902144 bytes (214137 MB)
Nothing to do: NTFS volume size is already OK.
real resize    ( ERROR )
    
ntfsresize -P --force --force /dev/sda5
    
ntfsresize v2012.1.15AR.1 (libntfs-3g)
Device name : /dev/sda5
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 214136902144 bytes (214137 MB)
Current device size: 214136907264 bytes (214137 MB)
New volume size : 214136902144 bytes (214137 MB)
Nothing to do: NTFS volume size is already OK.
Finally I could resize the NTFS partition and make a new ext4 partition to install Ubuntu 12.04.
















Saturday, May 12, 2012

Using Micromax 3G Modem on Ubuntu 12.04

In Sep 2010 I had written about using Micromax 3G modem on Ubuntu 10.04. Since then I could not find time to see whether Ubuntu 10.11, 11.04 and 11.10 has any changes wrt modeswitch etc. In Ubuntu 12.04 the newest version of usb-modeswitch is already installed by default and  mode switching takes place in the background.

Today I downloaded the iso of Ubuntu 12.04 Desktop iso and made a boot-able pen-drive and wanted to use the Micromax 3G Modem. Before implementing the procedure in my last post I searched and found following procedure on askubuntu:
Open up a terminal from Applications -> Accessories. Type:
sudo gedit /etc/modules
At the bottom of the file, make two new lines, like this:
usbserial
option
Then close the editor program and save it. Reboot the computer and hopefully you’ll be right from now on!

Since I was running from usb stick I used the following commands to load these modules:
sudo modprobe usbserial
sudo modprobe option

Then I inserted Micromax usb modem and configured a new Mobile Broadband connection through the Network Manager.

Although the Network Manager had not detected the insertion of modem but after configuring the connection it worked.

If you have installed Ubuntu 12.04 and want to use this modem on regular basis you can edit /etc/modules file as per the procedure on askubuntu so that the modules would be loaded on boot.

If you want to occasionally use this modem you can use my procedure i.e. to load the modules before inserting the modem.

NB: Network Manager takes about 3 minutes to detect the modem on LiveCD/USB or even installed Ubuntu 12.04. You need to have some patience after inserting the modem. In addition the modules 'usbserial' and 'option' need to be loaded before insertion as described above. In Ubuntu 11.10 this Modem shows up in Network Manager after a few minutes without giving any command.

One visitor wanted me to post screen shots. Here they are.

Air India direct flight to San Fransisco has flown through China today.

 My sister in law left for San Fransisco by AI 173 flight which flows over North Pole. I tracked that flight on flightstats.com till it land...