Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How would I convert a persistent filesystem (live-rw) from a Debian Live USB to a standalone, bootable installation that can be run on a VM?

What I've tried

  1. Chrooting and installing a bootloader (grub) - Can't chroot since the filesystem (live-rw) is a very limited installation, no bash etc.
  2. Installing Debian from this USB in hope that it will preserve the persistent files (like Ubuntu does) - installs a clean system.

Full story

I have been given files copied from a Live Debian (Squeeze) USB that has been used with the persistent option. I need to convert the persistent filesystem to a standalone installation and put it on a vmware vSphere VM, as it contains configured servers/services I would rather not configure from scratch.

Since the persistent file (live-rw) is just an ext2 filesystem i thought I would only need to install a bootloader and provide kernel/initrd image. The problem is this image has no /proc /sys and /dev nodes and only a few binaries in /bin (can't even chroot into it without bash)

$ file live-rw 
live-rw: Linux rev 1.0 ext2 filesystem data (mounted or unclean), UUID=fa55a4d2-1fc4-5344-9e94-dc12cb60612d (large files)

Contents of /:

$ ls /
bin  etc  home  lib  live  lost+found  media  opt  root  sbin  tmp  usr  va

Contents of /bin:

$ ls /bin/
bunzip2  bzcat  bzcmp  bzdiff  bzegrep  bzexe  bzfgrep  bzgrep  bzip2  bzip2recover  bzless  bzmore

I had an 'A ha!' moment when I realized that I would just need to install Debian from this USB drive and that would keep my persistent data. This is how Ubuntu works I believe. I've created an empty image, partitioned and formatted it, copied the USB file and installed MBR & extlinux. However after booting and running an installation from this USB it has only installed a clean system...

What should I do in this situation? How to convert this image fully featured Debian installation?

I know it can be done, it's Linux after all...

share|improve this question
I don't know of a one-stop solution, but dpkg-repack might help? – tripleee Jul 1 '13 at 4:18
@tripleee thanks, I now know a handy tool! It won't cut it I'm afraid, since not everything has been installed through a package manager/deb files. – szalski Jul 1 '13 at 12:07
What kind of persistent information is the one you want to keep? User data (/home)? system configuration files (/etc)? Depending on what you want it may be as simple as copying to the new install the files you require. Or you can use the same technique to make a live usb from a DVD/CD to create your system from what you already have. – YoMismo Jan 14 '15 at 16:48

This should not be different, than copying a Installation from one partition to another. You only have to copy the files.

If you google for that problem there are quite a few guides. Also remember, that you don't have to clone the partition - a 'simple' copy works,too.

share|improve this answer
Could you expand on your answer a bit? What do you mean by copying the files? Copy files from the live-rw partition over to an existing, healthy installation or to a clean disk/partition? If it's the latter, I have tried that and it won't work because the live-rw partition is a stripped down version of a full system (limited binaries, etc.). – szalski Jul 7 '13 at 19:29
he literally means cp -r :) afterwords you'll probably have to setup the bootloader and you're good to go...I think – Alko Jan 14 '15 at 16:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.