Can I move Linux from running on a USB to a hard drive partition?

6,700

Linux is easily cloned because it doesn't depend on hard drive sector placements to boot. What you will need:

  1. Backup your computer AND your USB drive.
  2. Create your partition table with at least one Linux-compatible file system
  3. Boot from a live CD and rsync your system from the USB drive. (Don't boot from the USB in question).
  4. Edit your /etc/fstab to reflect your new drive configuration.
  5. chroot into your new system and set up grub as your boot manager.
  6. Reboot.

I won't go into detail on each of these steps because it's a risky procedure and you need to do your research on this yourself. At any rate, do your backups! Did I mention you need to create backups first?

Share:
6,700

Related videos on Youtube

techturtle
Author by

techturtle

Updated on September 18, 2022

Comments

  • techturtle
    techturtle over 1 year

    I'm working on helping my brother with a project. He has been running Lubuntu Linux from a USB drive while he was setting up some server and web projects (proof of concept).

    Now that he has the official OK from his company to roll it out, he would like to transfer the OS that resides on the USB to a partition on his hard drive, so he can avoid having to reconfigure everything on a clean install.

    Neither of us has cloned a Linux install before, so I'm not sure where to start or if this type of clone/move is even possible.

    • mu1988
      mu1988 about 11 years
      Possible, yes. But if you can't find a one-click option provided by Ubuntu, I would suggest not trying it as a newbie. Using the normal installer will handle a number of hassles for you. You could then try to copy various things over, like feeding.cloud.geek.nz/posts/… EXCEPT the liveusb storage is probably a bit exotic to get access to. You could do it the other way to that guy: after the hard drive install, you can boot the liveusb again, and at least copy your home directory to the hard drive. Good luck.
    • Paul
      Paul about 11 years
      I agree with @sourcejedi - except to say not only is this possible, it is fairly straightforward as compared to windows, and cloning linux is common practice and doesn't need special tools - you can literally just copy the files. However, you will need to set up the bootloader, possibly use a different kernel, and fix up /etc/fstab. Without experience, these things are likely to be a showstopper.
    • mu1988
      mu1988 about 11 years
      You forgot: also (usually) need to shrink the Windows partition and create a new partition for Linux :). That's the scariest bit IMO.