Visit Our UNIX and Linux User Community


Copy existing Ubuntu to boot from USB


 
Thread Tools Search this Thread
Operating Systems Linux Ubuntu Copy existing Ubuntu to boot from USB
# 1  
Old 02-25-2014
Copy existing Ubuntu to boot from USB

Hello all,

I am looking for a way to copy the existing Ubuntu server 12.04 to a USB (with all the packages and such) and make it boot from the USB.

I have seen other threads about copying the CD image to the USB, which is not exactly I am looking for.
Before I start diving into anything I was wondering if any of you experts here would give me a direction to start.

Thank you!
# 2  
Old 02-25-2014
Is the USB bigger or smaller than your hard drive?
# 3  
Old 02-25-2014
The USB significantly smaller. HD is about 150GB and USB is about 8 GB
I think I can get into LVM and shrink the size? Is that possible?

Here is the partition table:
Root is only used about 2.0 GB total usage only about ~ 5 GB

Code:
Filesystem                    Size  Used Avail Use% Mounted on
/dev/mapper/ubuntu2--vg-root  145G  2.0G  135G   2% /
udev                          994M  4.0K  994M   1% /dev
tmpfs                         401M  340K  401M   1% /run
none                          5.0M     0  5.0M   0% /run/lock
none                         1003M     0 1003M   0% /run/shm
/dev/sda1                     236M   31M  193M  14% /boot


Last edited by br1an; 02-25-2014 at 03:55 PM..
# 4  
Old 02-27-2014
Never mind I decided I do the installation from scratch on to the USB.

However another question if I wanted to clone that USB using the
Code:
dd if=/dev/usb1 of=/dev/usb2

It should copy everything from the first USBbyte for byte including the boot loader.
Provided that they are the same size/USB2 is bigger...
Will this make the USB2 bootable?
# 5  
Old 02-27-2014
A scratch installation sounds like a better idea, shrinking and moving all those partitions while technically possible sounds fraught with peril.

Correct, the drive's contents determine whether it's bootable, there's no hidden other things.

Be sure to copy the entire device, i.e. /dev/sdc, and not a partition, /dev/sdc1 etc. Not necessarily sdc of course.

You'll probably want to add 'bs=4M' to your dd command to speed it up. It just makes it copy in larger blocks. Should be easier on your flash drives too.

Previous Thread | Next Thread
Test Your Knowledge in Computers #679
Difficulty: Medium
IEEE 802.3 CSMA/CD, CSMA/CD stands for Carrier Sense, Multiple Authorization with Collision Detection.
True or False?

8 More Discussions You Might Find Interesting

1. Solaris

T5220 not able to boot from USB

Hi, I want to install Solaris-11 on T5220. I created USB from sol-11_4-text-sparc.usb by usbcopy on another Solaris-11 servers, which looks like a good one. I tried did "reset-all" and still same issue. Can I get some help on this. {0} ok reset-all Sun Netra T5220, No Keyboard Copyright... (8 Replies)
Discussion started by: solaris_1977
8 Replies

2. Ubuntu

Installing UBUNTU on USB stick

I'd like to install the OS on my stick. I would like to be able to save my works there and install apps or customize the OS. What can I do Ps. At home I use an iMac, but in the school where I work there are only PC... Ty (2 Replies)
Discussion started by: Fabio_Puricelli
2 Replies

3. Ubuntu

[SOLVED] Dual boot Windows 7 and Ubuntu on USB

I am trying to dual boot on an external USB 500GB drive using my laptop.I have Windows 7 installed and booting on 1st partition 230GB now as active primary, 2nd partition is 100GB as primary, and 3rd partition is 135GB as primary. I was intending on installing Ubuntu onto the 2nd partition. I read... (12 Replies)
Discussion started by: coolecho
12 Replies

4. Ubuntu

Ubuntu on USB stick?

Hey Guys I have an Ubuntu CD and I was thinking of creating like a bootable hard drive with various OS so that I can just boot OSs with t drive and not require the CDs. I was just wondering is there a way I can do this, like have Ubuntu boot from a USB stick? If yes how is that possible(even if I... (3 Replies)
Discussion started by: rbansal2
3 Replies

5. Shell Programming and Scripting

Building a script in Ubuntu (Linux) from existing DOS .cmd

Greetings, I would be very grateful to anyone who is willing to help and knows there scripting and how to convert a DOS CMD script. :) In this posting I am also hoping to pass on information to anyone wanting to see a bit of VMware command line stuff. I have made a script (batch file) that runs... (11 Replies)
Discussion started by: dp123
11 Replies

6. Linux

Usb Boot

Hi I am trying to create a fedora 11 usb boot disk for my acer aspire note book. Problem is the only access i have to another machine is a mac running leopard. Can some one tell me how i go about this please Treds (3 Replies)
Discussion started by: treds
3 Replies

7. Linux

How to boot Fedora 8 from USB

Hi, friends, can anyone suggest me how to boot fedora 8 from USB flash drive? thanks. :confused: (3 Replies)
Discussion started by: MULTIVERSE
3 Replies

8. Shell Programming and Scripting

How to copy one folder to another with existing files

For example, /tmp/folder1 includes /tmp/folder1/a /tmp/folder1/b /tmp/folder2 includes /tmp/c Is there a command without removing files in /tmp/folder2 first to copy the /tmp/folder1 to /tmp/folder2? and the result should be /tmp/folder2 will include only /tmp/folder2/a... (2 Replies)
Discussion started by: lalelle
2 Replies

Featured Tech Videos