Creating labels for disks in ubuntu

March 31, 2008

The ability to create or change the disk label of fat/fat32/vfat file systems/partitions doesn’t come with Parted; yet is quite simple to achieve with Ubuntu Debian GNU/Linux :).

This comes in very handy when you have a number of fat devices (like USB, SD, etc) and want something more meaningful than just “disk” as its name.

Get mtools if you haven’t it already
sudo apt-get install mtools

Create a configuration file to avoid some error reporting
echo “mtools_skip_check=1″ > ~/.mtoolsrc

Check where your disk is in the linux devices
mount

Label your disk
mlabel -i /dev/sdb1 -s ::my_disc

…and there you have it.

Disconnect the device and reconnect it and the label will show when it is auto mounted.


Undelete files on a vfat partition in Ubuntu

March 31, 2008

I have recently used the ‘photorec’ component of the ‘testdisk’ application for recovering files from FAT32 file systems.

I had used it before to recover files from general USB devices and others like Compact Flash/MMC/Secure Digital media with great success.

Then, I was focusing on recovery of photos and movies.

This time I was looking for various non-image files. Again I was suitably impressed by its coverage, and its simplicity in terms of use and speed.

They name may suggest only photos, but this is a great piece of software, regardless of what kind of file you are trying to recover.


Spoofing your Browser

March 31, 2008

Web servers sometimes behave differently for different browsers, for compatibility reasons usually, but not neccessarily.

If you want to test how a system or site behaves for different browsers, plugins for firefox such as the ‘User Agent Switcher‘ can help. With it you can enter any data for the User Agent string.

The User Agent String is essentially a text string that your browser sends with each request to tell the server what browser, operating system, extensions/plugins, etc you are using.

I didn’t initially find the format or usage of this plugin to be very intuitive, but thankfully there are importable files online with settings for many of the more common combinations of browser/os etc. One such list I have used is at http://qainsight.net. Check for updates to the version of the script. Right now the site is offline, but the latest (March 2008, from internet caches) appears to be here.

Last I read it does not properly cater for the different User Agent String formats of other browsers, for instance the IE and Firefox string are quite different in both content and organisation. So while it will usually work, it may sometimes fail, and will probably not hide the fact of what browser you are actually using from those who might really want to know…