Tag Archives: linux

Install full Ubuntu on USB flash drive


This is a repost of the forum topic! Link below.

Here I’m going to explain on how to install a fully working linux specifically Ubuntu 12.04 LTS on USB Flash drive

Pro’s of installing linux in a USB flash drive

1. Linux is a great OS which can run on a variety of computers without the need of additional drivers unlike windows where you have to install drivers every time you install the OS. So you can say it’s a very good OS having very good mobility. ( Now it is challenged by ‘windows to go’ feature of windows 8 which is going to be released very soon)

2. Linux requires very less hardware to run.

3. In linux, drivers do not conflict unlike windows so it’s easy to use same linux installed on USB flash drive to work with different computer.

4. You can carry your personal and customized OS with you anywhere you want on a USB.

5. Various application can be installed on it like avast antivirus, Gparted etc…. which can rescue a broken system.


Con’s of installing linux in a USB Flash drive

1. As USB flash drives are slow than Hard Disks so the OS will run really slow. Mind it, it will be annoyingly slow.

2. Installing OS on USB may eat your USB Flash drive soon as Flash drives have limited write cycles.

3. Browsing may seem very slow as browsers waits to read cache from filesystem.


Now as you have seen the pro’s and con’s now we will proceed on installing linux.

If you have not downloaded ubuntu then download from www.ubuntu.org

After downloading burn the downloaded image on CD or DVD and boot from it.

You need at least 4 GB Flash Drive but 8 GB is recommended.


Here is step by step procedure

1. Boot from live CD in ubuntu.

2. Insert the USB flash drive in USB Port.

3. On desktop double click on icon ‘install ubuntu 12.04′

4. Click on continue and it will ask if you want to unmount the flash drive click on yes

5. Choose something else when ask to where to install ubuntu.

6. Next you will see your hard disk partitions and flash drive. Click on flash drive partition and then click on change. Change the partition type to ext4 and mount as to ‘/’. Click on ok to close the dialogue box.

7. In last you will see a drop down menu on where to install the the boot loader. Initially it will be showing sdc,sdd but on drop down you must select sdc1 or sdd1. Failing this step you may render your computer unbootable.

8. Then click on install and linux will be installed on your USB Flash drive.


Thanx to Gauravs90 !

JDK quick install on Ubuntu Linux

Quick reference to install JDK7 on Ubuntu.

1. Download the JDK7 from oracle.com
2. Create dir and unpack:

sudo mkdir -p  /usr/lib/jvm/
sudo mv java-7-oracle/ /usr/lib/jvm/

3. Get script to change alternatives:

wget http://webupd8.googlecode.com/files/update-java-0.5b

4. Change exec permissions:

chmod 755 ./update-java-0.5b

5. Finally, execute it:


Select your JDK:

To check that’s all ok, use next:

java -version
javac -version

Source http://www.webupd8.org/2011/09/how-to-install-oracle-java-7-jdk-in.html
And http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html

Set file and folder permissions in Linux

Convenient way to apply permissions in Linux is to save alias in .bashrc file:

Set all permissions for FTP:

alias setftpperm="chown -R _pure-ftpd:_pure-ftpd /usr/serv/ftp/anonymous && \
    chmod -R u+rwX,go+rX,go-w /usr/serv/ftp/anonymous && \
    chmod -R u+rwX,go+rX,go+w /usr/serv/ftp/anonymous/PUBLIC && \
    chmod -R u+rwX,go+rX,go+w /usr/serv/ftp/anonymous/TORRENTS"

Next is permissions for Apache:

alias setapacheperm="chown -R _pure-ftpd:daemon . && \
  chmod 666 . && chmod -R u+rwX,go+rX,go-w ."

alias setapachewperm="chown -R _pure-ftpd:daemon . && \
  chmod 666 . && chmod -R u+rwX,go+rX,go+w ."

Network configuration in Linux

As a rule, network configuration in Linux is placed in /etc/network/interfaces file.

Here is the example of such config:

## The primary network interface - use DHCP
# auto eth0
# iface eth0 inet dhcp

## The primary network interface - use Fixed IP
auto eth0
iface eth0 inet static

## This dns entry will push information to resolvconf.

To restart network configuration just use next commands:

# /etc/init.d/networking restart

or this:

# ifdown eth0
# ifup eth0

Set screen resolution in Linux


To control screen resolution use xrandr command.

Set default optimal resolution:

xrandr -s 0

To set concrete value:

xrandr -s 1680x1050

See http://xorg.freedesktop.org/wiki/Projects/XRandR

Mount ISO in Linux

To mount ISO file as CD disk, try mount command:

mount -o loop,ro /home/user/disk.iso /media/cdrom

To unmount:

umount /media/cdrom

For Ubuntu users see https://help.ubuntu.com/community/MountIso

For GUI performing, use Gmount-iso:


sudo apt-get install gmountiso

Grab sites with WGET

To download whole site use the next snopet:
wget -r -l0 -k -p http://site.name