Copy a Japanese-encoded FAT32 Volume
I recently was asked by a friend to help transfer files from a defunct computer to his new laptop. It appeared at the outset this would be a trivial affair; however I soon ran into difficulties. The key issue was that the defunct computer was set up with the Japanese language edition of Windows XP, with the filesystem formatted using FAT32, while the new system was an English language version of Windows Vista.
I soon entered a world of character code hurt – unbeknownst to me at the time, the filesystems of international editions of Windows are essentially incompatible with each other! Apparently, the set of supported filesystem character codes is fixed in each localized Windows kernel – short of installing Windows in that language, you will be unable to read any filesystems created using its character code!
Fortunately, Ubuntu comes to the rescue! Albeit not without some confusion and a healthy dose of wasted time. Here I outline the steps I took to copy the Japanese-encoded FAT32 filesystem content to an English Vista NTFS drive. You might be able to skip some of the steps, but I include them all for completeness.
- Connect the FAT32 drive to an Ubuntu box.
- In a terminal, change to the superuser (we’ll need to be root for most steps):
sudo su - Mount the drive using the Japanese character code:
mount -o codepage=932,iocharset=utf8 -t vfat /dev/sdb1 /mnt/temp - Copy the drive contents to the local drive. (You might be able to skip this step by copying directly to the USB drive.)
cp -r /mnt/temp ~/backup - Did I say you needed a USB drive handy? Well, how else were you planning to transfer the files? We need to have an NTFS partition on the drive. I did this using GParted, so that I could have a FAT32 partition alongside an NTFS partition. GParted should be pretty straightforward to use – the only thing to note is that creating the initial partition tables will delete any existing data on the drive. We’ll also need NTFS write support. Install the following packages:
apt-get install gparted ntfs-3g ntfs-config ntfsprogs - Run
ntfs-config. You can cancel out of the first dialog, but make sure “Enable write support for external device” is checked in the second dialog. - Install the Ubuntu Japanese language pack, if you haven’t already. In Interpid:
System > Administration > Language Support, tick “Japanese” and hit “OK”. - Verify the locale was added:
locale -a | grep ja_JP - Set the
LANGand LANGUAGE environment variables:export LANG=\"ja_JP.utf8", thenexport LANGUAGE=\"ja_JP.utf8". - Make sure the USB drive is not mounted. If it was automounted, for example on
/media, unmount it:umount /media/disk. If the FAT32 drive is still mounted, you can unmount that too. - Mount the USB drive specifying a Japanese locale:
mount -o locale=ja_JP.utf8 /dev/sdf2 /mnt/temp - Copy the files from the local drive to the USB drive:
cp -r ~/backup /mnt/temp/ - Unmount the USB drive and disconnect it from the Ubuntu box, reconnecting it to the Vista box.
- In Vista, perform a simple file copy from the USB drive to the desired location.
I hope this helps any poor souls out there put in the same situation as I was, for Japanese or any other multibyte language!
January 28th, 2009 at 07:48
Hey,
I have a doubt. I have a test suite which has 3 test java files. 1st one gets passed; second one fails; third one passes again.
Somehow, once the second fails, the whole test suite is getting halted and not and I have to stop the RC and start all over again. Can you please help me here? I am using Selenium RC, TestNG framework. Annotations are used based on my rudimentary understanding.
If you could please help me, I can save myself from a huge avalanche. Please.
Regards,
Shreyas
January 28th, 2009 at 07:49
Sorry for the wrong place. Since i wanted it to be seen, I placed in your most recent article.