Featured Post

Using USB CDMA modem to setup a home/private WiFi network

The idea here is to give a ‘how-to’ on setting up a a home WiFi network using mobile, CDMA based USB modem, hoping that bandwidth that you obtain from this service is satisfactory :-) Hardware Requirements: Linux PC/Notebook/Netbook Wifi Access point connected to ethernet port of the Linux box CDMA-1x USB Modem (Device used: Reliance M880) Software/OS Requirements: Linux Operating System with “usbserial” and “cdc_acm” device driver modules “pppd”, “wvdial”, “iptables”, and “dnsmasq” applications and their dependencies installed on the System Setup: The steps followed in setting up this CDMA based connectivity can be split into 3 steps, as follows. Configuring kernel modules for auto-loading at bootup Configuring “wvdial” application for dialup / ppp connection Initializing / starting the CDMA modem connection Setting up “iptables” for NAT forwarding Setting up “dnsmasq” for resolving DNS and as DHCP server Configuring kernel modules for auto-loading at bootup Open

Making persistant liveUSB from liveCD image

“Universal Serial Bus” is today one of the most common interface available in the computer to communicate with it in various aspects. Having a mobile storage device that seamlessly (well, at least in possible situations) boots on a standard i386 based hardware and allows one to perform his/her work will definitely make the life a lot comfortable. LiveUSB distro is meant to serve this purpose.

Creating a LiveUSB distro using Ubuntu LiveCD iso on a typical Desktop PC / Laptop is explained with the following steps. These steps are meant to be for users already comfortable using command line utilities. For rest of the folks, there are readily available tools. Some of them are, UNetbootin and Liveusb.


1. Install ‘gparted’, ‘syslinux’, ‘mtools’ and ‘squashfs-tools’ using Synaptic package manager or apt-get using a terminal.

2. Download the latest Ubuntu LiveCD distribution for Desktops, from www.ubuntulinux.org.

3. You need to have superuser access (sudo) or should be able to login as root since, below mentioned steps need superuser privileges.

Procedure / Steps:

1. Insert a bootable USB thumb drive of capacity >=4GB into the USB port on the Computer. Make sure that your device is capable of working as bootable USB device. Unfortunately, not all the USB drives available in the market are capable of supporting boot feature. Two of the known brands which can be used for the purpose here are Kingston, and SanDisk. Again, cross-check them before you actually buy them for this purpose. Finally, make sure that you have any data backed up from the drive before proceeding further. Since, the aim is to use the device for persistent storage, I recommend a minimum of 4GB.

2. Create 2 partitions on the inserted USB device by using ‘gparted’ tool. Make sure that you select your USB device properly from the list of scanned disk devices. You need to unmount any mounted partitions from the drive and delete them. Then, create first, primary FAT16 partition of ~1.2GB size and then, with rest of the freespace create second, EXT2 partition. One can use fdisk or cfdisk tools instead of gparted if familiar with them.

3. Close gparted tool. Open a terminal and format the newly created partitions as follows:
  • mkfs.vfat -F 16 -n liveusb /dev/sdX1
  • mkfs.ext2 -b 4096 -L casper-rw /dev/sdX2
where, X in sdX refers to the device letter. Please check for your USB device’s letter and replace it in place of X (Example, your device name may be sda, sdb, sdc, or ….)

4. Create master boot record (mbr) on your USB device
  • dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdX
5. Create two directories, in /tmp and mount the newly created partitions of the USB device on them.
  • mkdir -p /tmp/{liveusb,casper-rw}
  • mount /dev/sdX1 /tmp/liveusb
  • mount /dev/sdX2 /tmp/casper-rw
6. Create a directory named livecd in /tmp and mount the LiveCD iso as loopback device.
  • mkdir -p /tmp/livecd
  • mount -o loop /path/to/livecdiso /tmp/livecd
where, ‘/path/to/livecdiso’ is the absolute pathname to Ubuntu LiveCD iso image.

7. Copy the contents of /tmp/livecd to /tmp/liveusb and do some tweaking as follows:
  • cp -rf /tmp/livecd/* /tmp/liveusb
  • mv /tmp/liveusb/isolinux/* /tmp/liveusb
  • rm -rf /tmp/liveusb/isolinux*
  • mv /tmp/liveusb/casper/initrd.gz /tmp/liveusb/casper/initrd.img
8. Copy the files syslinux.cfg, isolinux.txt into /tmp/liveusb as well as /tmp/casper-rw.

9. Now, unmount the temporarily mounted stuff
  • umount /tmp/livecd
  • umount /tmp/casper-rw
  • umount /tmp/liveusb
10. Finally, install the boot-loader by running;
  • syslinux /dev/sdX1
You may use the options -s and -f along with syslinux (Eg., syslinux -s -f /dev/sdX1)

That’s it! You have the LiveUSB. Now, remove it from the Computer and try it on any Desktop PC / Laptop that allows booting from USB storage device. You need to check in the BIOS to make sure that USB disk is the first boot device in the boot order or no other devices higher in the boot order can boot before USB disk. Enjoy with your persistent LiveUSB:-) drive.


Popular posts from this blog

How to extract an initrd image

Using USB CDMA modem to setup a home/private WiFi network

Debian Squeeze and Mac OSX Lion - Dual boot