How to put my running linux on a usb stick??

Asked by oocevin on 2011-08-08

I want to install my running linux to a usb so I can go to any pc and plug it in and
boot into my running system.
My user and password and every thing I have installed on my PC

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu coreutils Edit question
Assignee:
No assignee Edit question
Solved by:
Eliah Kagan
Solved:
2012-01-06
Last query:
2012-01-06
Last reply:
2011-08-09
Maxim Petrov (maximpetrov) said : #1

Just copy all data to the usb stick and install grub on it

Maxim Petrov (maximpetrov) said : #2

But it will be better to boot from LiveCD otherwise copying of some folders like /dev, /proc and /sys cause troubles.

oocevin (ccct007) said : #3

I want to be able to go any where and have my system
with me. My friends run windows. I do not like it.

I tried to use startup disk creator.

Do I use file system put all in there?

Maxim Petrov (maximpetrov) said : #4

If you want to use normal system, not LiveUSB, use shouldn't use startup disk creator.

oocevin (ccct007) said : #5

What I'm trying to do is take my lubuntu 10.10 with gnome-panel on it with all of my bookmarks
and all. It would be like taking my pc with me.

I use the startup disk creator to install lubuntu 10.10.

Now I want to put that on my usb stick. I can plug it in
and log into my system on some one else's pc.

It would be like taking a laptop, but in a usb stick.

Lets say I install the system and set it up like I want
it. Now I want to put that on the usb stick. I very own
pocket system. Pull it out and plug it in and log in.

Not installing nothing on that PC. Just loading my
system to surf with my system that I have on my home pc

Maxim Petrov (maximpetrov) said : #6

As I said in #1 you should copy all system data from your home pc to usb stick. It would be better if you boot from LiveCD to do it. Then you should install grub on yuor usb stick and correct /etc/fstab

Maxim Petrov (maximpetrov) said : #7

Another way is to install Ubuntu from LiveCD like usual, but choose partiton of usb stick as "/". In this case don't forget to choose where to install grub. This way simlpier but you'll get new system with default setting and installed software.

oocevin (ccct007) said : #8

I will have to go to a pc man to show me.

He said it can be done but I do not.

I'm not trying to install linux to my pc.
I want my linux that is already installed on my pc loaded to the
usb.

That way I can use it on any pc-laptop and log into my system
that I have install on my pc at home.

I am sorry if I am not getting it. I'm using the system that
I installed from my usb stick. I know to do that.

Putting my installed system on my usb

Maxim Petrov (maximpetrov) said : #9

Hmm... May be i misunderstand you. You have ubuntu installed on your pc. You want to get copy of that ubuntu on your usb stick. Or not?

oocevin (ccct007) said : #10

Most definitely.

I want to clone my hdd to the
usb stick..

Lets say my hdd is empty. I plug in the usb and and
turn on the pc and it goes to the desktop of my
lubuntu 10.10 with gnome-panel on it.

Be just like if I carried my pc with me. But on the usb
stick.

Maxim Petrov (maximpetrov) said : #11

Your hdd is empty now? Or you mean that you want to boot without system on hdd?

oocevin (ccct007) said : #12

No my hdd is not empty. I want to clone it.

I want to put my hdd system lu 10.10 on the usb stick so
I can boot it on other pc-laptop which ever one that I am
on at the time.

I'm using the system that I want to clone.

You can create cloned copies of an Ubuntu installation using CloneZilla (http://clonezilla.org) or, probably less preferably, dd (http://manpages.ubuntu.com/manpages/natty/en/man1/dd.1.html).

Maxim Petrov's original suggestion should also work, though it is more complicated. In a bit more detail than he stated it, it is:

(1) Create an ext4 filesystem on the target drive. You might want to use a utility like GParted for this. If you want the target system to have a swap partition, create that too.

(2) Boot from a live CD/DVD/USB that is neither the source nor the target drive.

(3) Mount the source and target drives' root filesystems, which might look like this (but don't just run these commands as-is, check to make sure they have the right device names):

sudo mkdir /source /target
sudo mount /dev/sda1 /source
sudo mount /dev/sdb1 /target

(4) Copy all the files from the source drive to the target drive:

sudo cp -R /source/* /source/.* /target

(5) [Re]install the GRUB2 boot loader to the target drive's Master Boot Record (https://help.ubuntu.com/community/Grub2#Copy%20LiveCD%20Files).

Using CloneZilla would probably be easier. Either way you do it (CloneZilla/dd or the above recursive file copy method), you may have to reinstall GRUB2 to the drive's MBR. And either way you do it, if there are problems, you might end up needing to edit /etc/fstab in the newly created system.

oocevin (ccct007) said : #14

Thanks Eliah Kagan, that solved my question.