How to move Linux on a USB stick to a hard drive partition?

6,806

Try installing Ubuntu and moving home directory to your new system.

If you need to move it and it's a proper installation (not live version) then use

dd bs=4M if=/dev/partition_on_pendrive of=/dev/partition_on_disk

Then chroot into partition you've created and install grub. Don't forget about swap.

Share:
6,806

Related videos on Youtube

user1780775
Author by

user1780775

Updated on September 18, 2022

Comments

  • user1780775
    user1780775 over 1 year

    I was running Ubuntu on a USB stick for a while because my hard drive had failed. It had two partitions.

    I recently installed a new hard drive and installed Windows on it. I created a new partition inside Windows that is larger than the USB stick.

    My question is: how do I move Linux to this partition on the new hard disk so that I have a dual-boot system? I downloaded a program called EaseUS Todo Backup but it can only clone a hard disk onto a hard disk or a partition onto a partition. Ubuntu is installed on the whole USB stick and has two partitions of about equal size.

    Does anyone know how to do this?

    • Mark Kirby
      Mark Kirby over 9 years
      You can clone the HDD, which is complicated linux.com/learn/tutorials/… but if you tell we what exactly you want to save from your USB install, mabey we can find a way to do a new install and save the data
    • Mark Kirby
      Mark Kirby over 9 years
      If you want to clone the drive I will simplify it for you, please make another live USB/DVD so you have two (one to clone and a new one to boot) and boot to this, make sure all three devices are connected (two usb and one HDD) open a terminal and run sudo apt-get install ddrescue and when it finishes run lsblk and add all the output of this to the question.
    • user1780775
      user1780775 over 9 years
      @markkirby I don't understand. What will that do? I want the Linux install on a partition for dual booting. I don't want to use the whole hard drive.
    • Mark Kirby
      Mark Kirby over 9 years
      You just want a new install in your partitrion ?
    • user1780775
      user1780775 over 9 years
      @markkirby Yes but I would rather clone the USB stick. I am a little nervous about trying to install to a new partition as I tried to do that in the past and it ended up inadvertently wiping out Windows even though I selected another partition.
    • Mark Kirby
      Mark Kirby over 9 years
      The page I linked is how to clone your usb, also if you know Ubuntu well przemo's answer is the same thing,
  • user1780775
    user1780775 over 9 years
    I'm a little bit confused. You are talking about cloning a partition but the Linux install has two partitions and I don't know how they connect to each other.
  • przemo
    przemo over 9 years
    Did you install system on pendrive or is it live distribution? If it's a live distro, then there is additional overlay partition and it becomes complicated. In that case I wouldn't recommend cloning, instead I would install new system and copy /etc /home. Use can always check /etc/fstab on pendrive (on running system) and mount overlay partition accordingly)
  • user1780775
    user1780775 over 9 years
    I installed a full system. It has two partitions, both around 7gb in size.
  • przemo
    przemo over 9 years
    Could you run your computer from pendrive and paste the output of mount ?