How to install Ubuntu on portable external Hard Drive?












24















OS: Windows 7. I want install Linux Ubuntu on portable external Hard Drive USB 2.0.
I read a variety of methods, but I'm confused by contradictory advices and methods. Actually, installing Ubuntu on anything other than clean PC looks much more complicated than installing Windows.
I need to have Ubuntu package + Python 2.7 + C compiler installed. My external hard drive is partially filled, I need to keep all files.



Will Ubuntu run entirely on external hardrive, without writing anythinhg to Windows system folders and to registry?



Can anyone post detailed guide how install Ubuntu on external hard drive?










share|improve this question

























  • Windows 7 Home.

    – triwo
    Apr 12 '14 at 0:39











  • What are your machine specs? How much room do you have on the usb hd? Does your chip have vt-x? I can give you the steps for an actual install, but since your Ubuntu needs are minimal, a virtual machine may be best for you. Of course, installing a VM writes to the registry, etc. Is this your own computer or work?

    – chaskes
    Apr 12 '14 at 1:09











  • Its my laptop. Intel Core 2 Duo CPU T6670, RAM 3GB. Not sure for vt-x. External hard drive 386GB free. VMware Player or VMware workstation? Probably Live CD will fit, but I need custom one with above packages + Binwalk with dependencies.

    – triwo
    Apr 12 '14 at 1:45













  • You have vt-x . You need to go into bios and make sure it's enabled. You'll be fine with a VM in VMWare Player, which is free (workstation is$ 250). Give 1024 MB ram to VM (you could even get by with 768). Your needs don't require a lot of space

    – chaskes
    Apr 12 '14 at 1:50













  • If it helps you, please remember to upvote or accept. :)

    – chaskes
    Apr 12 '14 at 2:45
















24















OS: Windows 7. I want install Linux Ubuntu on portable external Hard Drive USB 2.0.
I read a variety of methods, but I'm confused by contradictory advices and methods. Actually, installing Ubuntu on anything other than clean PC looks much more complicated than installing Windows.
I need to have Ubuntu package + Python 2.7 + C compiler installed. My external hard drive is partially filled, I need to keep all files.



Will Ubuntu run entirely on external hardrive, without writing anythinhg to Windows system folders and to registry?



Can anyone post detailed guide how install Ubuntu on external hard drive?










share|improve this question

























  • Windows 7 Home.

    – triwo
    Apr 12 '14 at 0:39











  • What are your machine specs? How much room do you have on the usb hd? Does your chip have vt-x? I can give you the steps for an actual install, but since your Ubuntu needs are minimal, a virtual machine may be best for you. Of course, installing a VM writes to the registry, etc. Is this your own computer or work?

    – chaskes
    Apr 12 '14 at 1:09











  • Its my laptop. Intel Core 2 Duo CPU T6670, RAM 3GB. Not sure for vt-x. External hard drive 386GB free. VMware Player or VMware workstation? Probably Live CD will fit, but I need custom one with above packages + Binwalk with dependencies.

    – triwo
    Apr 12 '14 at 1:45













  • You have vt-x . You need to go into bios and make sure it's enabled. You'll be fine with a VM in VMWare Player, which is free (workstation is$ 250). Give 1024 MB ram to VM (you could even get by with 768). Your needs don't require a lot of space

    – chaskes
    Apr 12 '14 at 1:50













  • If it helps you, please remember to upvote or accept. :)

    – chaskes
    Apr 12 '14 at 2:45














24












24








24


19






OS: Windows 7. I want install Linux Ubuntu on portable external Hard Drive USB 2.0.
I read a variety of methods, but I'm confused by contradictory advices and methods. Actually, installing Ubuntu on anything other than clean PC looks much more complicated than installing Windows.
I need to have Ubuntu package + Python 2.7 + C compiler installed. My external hard drive is partially filled, I need to keep all files.



Will Ubuntu run entirely on external hardrive, without writing anythinhg to Windows system folders and to registry?



Can anyone post detailed guide how install Ubuntu on external hard drive?










share|improve this question
















OS: Windows 7. I want install Linux Ubuntu on portable external Hard Drive USB 2.0.
I read a variety of methods, but I'm confused by contradictory advices and methods. Actually, installing Ubuntu on anything other than clean PC looks much more complicated than installing Windows.
I need to have Ubuntu package + Python 2.7 + C compiler installed. My external hard drive is partially filled, I need to keep all files.



Will Ubuntu run entirely on external hardrive, without writing anythinhg to Windows system folders and to registry?



Can anyone post detailed guide how install Ubuntu on external hard drive?







system-installation external-hdd






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 22 '14 at 5:58









muru

1




1










asked Apr 12 '14 at 0:32









triwotriwo

2391210




2391210













  • Windows 7 Home.

    – triwo
    Apr 12 '14 at 0:39











  • What are your machine specs? How much room do you have on the usb hd? Does your chip have vt-x? I can give you the steps for an actual install, but since your Ubuntu needs are minimal, a virtual machine may be best for you. Of course, installing a VM writes to the registry, etc. Is this your own computer or work?

    – chaskes
    Apr 12 '14 at 1:09











  • Its my laptop. Intel Core 2 Duo CPU T6670, RAM 3GB. Not sure for vt-x. External hard drive 386GB free. VMware Player or VMware workstation? Probably Live CD will fit, but I need custom one with above packages + Binwalk with dependencies.

    – triwo
    Apr 12 '14 at 1:45













  • You have vt-x . You need to go into bios and make sure it's enabled. You'll be fine with a VM in VMWare Player, which is free (workstation is$ 250). Give 1024 MB ram to VM (you could even get by with 768). Your needs don't require a lot of space

    – chaskes
    Apr 12 '14 at 1:50













  • If it helps you, please remember to upvote or accept. :)

    – chaskes
    Apr 12 '14 at 2:45



















  • Windows 7 Home.

    – triwo
    Apr 12 '14 at 0:39











  • What are your machine specs? How much room do you have on the usb hd? Does your chip have vt-x? I can give you the steps for an actual install, but since your Ubuntu needs are minimal, a virtual machine may be best for you. Of course, installing a VM writes to the registry, etc. Is this your own computer or work?

    – chaskes
    Apr 12 '14 at 1:09











  • Its my laptop. Intel Core 2 Duo CPU T6670, RAM 3GB. Not sure for vt-x. External hard drive 386GB free. VMware Player or VMware workstation? Probably Live CD will fit, but I need custom one with above packages + Binwalk with dependencies.

    – triwo
    Apr 12 '14 at 1:45













  • You have vt-x . You need to go into bios and make sure it's enabled. You'll be fine with a VM in VMWare Player, which is free (workstation is$ 250). Give 1024 MB ram to VM (you could even get by with 768). Your needs don't require a lot of space

    – chaskes
    Apr 12 '14 at 1:50













  • If it helps you, please remember to upvote or accept. :)

    – chaskes
    Apr 12 '14 at 2:45

















Windows 7 Home.

– triwo
Apr 12 '14 at 0:39





Windows 7 Home.

– triwo
Apr 12 '14 at 0:39













What are your machine specs? How much room do you have on the usb hd? Does your chip have vt-x? I can give you the steps for an actual install, but since your Ubuntu needs are minimal, a virtual machine may be best for you. Of course, installing a VM writes to the registry, etc. Is this your own computer or work?

– chaskes
Apr 12 '14 at 1:09





What are your machine specs? How much room do you have on the usb hd? Does your chip have vt-x? I can give you the steps for an actual install, but since your Ubuntu needs are minimal, a virtual machine may be best for you. Of course, installing a VM writes to the registry, etc. Is this your own computer or work?

– chaskes
Apr 12 '14 at 1:09













Its my laptop. Intel Core 2 Duo CPU T6670, RAM 3GB. Not sure for vt-x. External hard drive 386GB free. VMware Player or VMware workstation? Probably Live CD will fit, but I need custom one with above packages + Binwalk with dependencies.

– triwo
Apr 12 '14 at 1:45







Its my laptop. Intel Core 2 Duo CPU T6670, RAM 3GB. Not sure for vt-x. External hard drive 386GB free. VMware Player or VMware workstation? Probably Live CD will fit, but I need custom one with above packages + Binwalk with dependencies.

– triwo
Apr 12 '14 at 1:45















You have vt-x . You need to go into bios and make sure it's enabled. You'll be fine with a VM in VMWare Player, which is free (workstation is$ 250). Give 1024 MB ram to VM (you could even get by with 768). Your needs don't require a lot of space

– chaskes
Apr 12 '14 at 1:50







You have vt-x . You need to go into bios and make sure it's enabled. You'll be fine with a VM in VMWare Player, which is free (workstation is$ 250). Give 1024 MB ram to VM (you could even get by with 768). Your needs don't require a lot of space

– chaskes
Apr 12 '14 at 1:50















If it helps you, please remember to upvote or accept. :)

– chaskes
Apr 12 '14 at 2:45





If it helps you, please remember to upvote or accept. :)

– chaskes
Apr 12 '14 at 2:45










3 Answers
3






active

oldest

votes


















31














A very detailed answer would be beyond the scope of a single question, but here's the general outline. It's very easy, but success will partly depend on the ability of your computer to boot from an external hard drive. This depends on the bios.



Before starting, make sure your bios has an option to boot from a USB HD.



If all you need is the basic install, Python 2.7, and the C compiler, you can get away with installing Ubuntu to a fairly small partition. I forget the literal minimum Ubuntu needs to install, but it's roughly 8 GB. I would recommend 10 GB as a minimum, plus another 2-4 GB if you want a swap drive.



Create space for a partition



It's best in your case to create the new partition before doing the install. You will need to shrink the existing partition on your external hard drive first.



I would recommend backing up the USB HD; but if you had a second one, you could just install to that one. Depending on how full the drive is, you may not be able to back it completely; but try at least back up any important files. This is just a general warning and precaution since your data should be safe.



You have two options to shrink the existing partition:




  1. Use the Windows partition manager in administrative tools. I believe these are available in Home Premium. If the partition won't shrink by enough, you may need to delete files to make room. If you have more than enough available but it still doesn't shrink enough, use a free defrag tool like MyDefrag to defrag and move the files to the start of the partition.


  2. Use gparted from the Ubuntu live install media. This is probably the easier way to do it.



Create a new partition



Create the Ubuntu live installation media and use it to boot your computer. Choose Try Ubuntu.



Plug in the external hard drive. Start the program gparted. If you have not already shrunk the partition on the external HD, do it now.



In most cases, the internal HD will show up as sda and the external as sdb, but this is not guaranteed. Be sure you are looking at the correct HD in gparted.



Shrinking the partition will leave unallocated space. Use this to create a new partition. Format it to ext4. Jot down the partition number. This will be used for /.



You don't need a swap partition, but if want one, shrink the new partition by the size you want (or just make it a little smaller in the first place). Format that space to linux-swap.



Note down the numbers of the new partitions.



Run the Installer



Start the installer from the icon on the desktop or on the launcher. When asked how you want to install, choose: Somethine Else.



This will start the partitioner within the installer. This is different than gparted and may look a little intimidating to a beginner.



Carefully highlight the new partition (check the number and drive carefully) and click Change.



Follow the dialogs to a. Use the partition as ext4, b. mount to /, and c. format.



Highlight the swap partition and click Change. Choose use a linux-swap and that's all for that one.



Very important: change the installation of the bootloader to the USB HD. This will most likely be /dev/sdb. This will prevent you from overwriting the master boot record on your hard drive. (If you do this by accident, it's easily fixed).



Double-check your partition choices, then click Install Now.





That's it. To run Ubuntu, boot the computer with the USB plugged in. Set your bios order or otherwise move USB HD to the first boot position. The boot menu on the usb will show you both Ubuntu (on the external drive) and Windows (on the internal drive). Choose the one you want. If you boot without the usb, you will boot into Windows normally.



Ubuntu has Python 2.7 installed by default. To install the C comiler, open the terminal, any run:



sudo apt-get install gcc


or



sudo apt-get install build-essential


(if you want some additional programs helpful for C programming).





To run Ubuntu in a virtual machine instead, install VirtualBox or VMWarePlayer in Windows. Both are free. Create a new VM and use the installer media to install to the VM. But this time, don't worry about partitions. Choose Install Ubuntu to the entire virtual drive. This doesn't affect the rest of the hard drive.



If you want to put the VM on the external hd, be sure to override the default location when creating the VM and put it on a folder on the external drive.



Creating your installation media with persistence through a Windows program like LiveUSBCreator will also work, but this option will be very slow.






share|improve this answer



















  • 1





    The Ubuntu 18.04 installer broke grub on my internal hard drive even though I chose installation of the bootloader to the USB hard drive, as advised in these instructions. I needed to run boot repair to recover.

    – Communicative Algebra
    Jun 7 '18 at 6:12





















8














Ubuntu can, and does, run well entirely from an external hard drive. I have used Ubuntu this way for years. It doesn't affect Windows. There's nothing special about installing to USB drives. You connect the USB drive, boot using a CD or an pen drive, and choose the external disk when it comes to selecting the installation location.



However:



You will have partition the external hard disk. I assume your external disk has a single partition with an NTFS filesystem. The best thing to do is shrink this partition by about 20 GB (which is more than enough for Ubuntu) and create new partitions there. This is not as difficult as it sounds (and you'd have to worry about partitions if you wanted to install another copy of Windows too).



Either use Windows' Disk Management tool to shrink the partition, or use GParted from the Ubuntu Live mode. Using the former is quicker, but limits you to whatever space is available after the last used sector in the partition (which can be very low, even if you have plenty of free space). Using the second can be very slow, especially if the partition is large, but lets you extract most of the free space.



In either case, after you get the free space, use GParted to create an extended partition there and within that extended partition, an ext4 partition. Install Ubuntu to this partition. Choose your external hard disk as the device for GRUB (bootloader) installation as well.



Alternative:



If you have a pendrive handy, use UNetBootin or Universal USB Installer or some such tool to create a bootable Ubuntu drive with persistence. If persistence is enabled, your settings and other changes to Ubuntu that you make when in Live mode don't vanish when you restart. It's ideal for low usage scenarios. You can install Python or anything else and get comfortable with Ubuntu, and then, whenever you feel ready, install Ubuntu. Note that changes made in the live mode do not affect any installation you make with it.






share|improve this answer



















  • 1





    2016, Unetbootin, Universal and other syslinux type installers are not working with 14,04 and later persistent installs. Grub2 type installers that do work for persistent partitions on thumb drives do not seem to be working for USB hard drives, even with casper-rw files or partitions.

    – C.S.Cameron
    Dec 7 '16 at 4:39











  • mkusb, help.ubuntu.com/community/mkusb, can create a persistent live drive in USB hard drives and SSD drives in external boxes with USB or eSATA connections. But the original poster wanted to keep all current files in the target drive, and mkusb will overwrite the partition table and create a new one. So it would not be an option for this case unless those data are backed up to another drive and restored after the persistent live system is installed.

    – sudodus
    May 4 '17 at 16:25



















0














I don't think this is fully supported via Wubi, but it can be done. I'm not entirely sure of how you plan to use it.



In the past, I've unplugged my Windows device, plugged in my external device, and just run through the install using the external (and in many cases, the only) drive. Ubuntu will install correctly and treat that drive as "a drive" - nothing special being external.



Then, rather than dealing with dual-boot and GRUB, I can just use the BIOS/uEFI options to select my preferred boot device after I reconnect my Windows drive.



There are other ways of doing it, but I've found this to be the easiest, with the absolute minimal risk to my Windows systems.






share|improve this answer



















  • 1





    I dont want open laptop and remove hard drive.

    – triwo
    Apr 12 '14 at 0:42










protected by Community Feb 26 '16 at 7:43



Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



Would you like to answer one of these unanswered questions instead?














3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









31














A very detailed answer would be beyond the scope of a single question, but here's the general outline. It's very easy, but success will partly depend on the ability of your computer to boot from an external hard drive. This depends on the bios.



Before starting, make sure your bios has an option to boot from a USB HD.



If all you need is the basic install, Python 2.7, and the C compiler, you can get away with installing Ubuntu to a fairly small partition. I forget the literal minimum Ubuntu needs to install, but it's roughly 8 GB. I would recommend 10 GB as a minimum, plus another 2-4 GB if you want a swap drive.



Create space for a partition



It's best in your case to create the new partition before doing the install. You will need to shrink the existing partition on your external hard drive first.



I would recommend backing up the USB HD; but if you had a second one, you could just install to that one. Depending on how full the drive is, you may not be able to back it completely; but try at least back up any important files. This is just a general warning and precaution since your data should be safe.



You have two options to shrink the existing partition:




  1. Use the Windows partition manager in administrative tools. I believe these are available in Home Premium. If the partition won't shrink by enough, you may need to delete files to make room. If you have more than enough available but it still doesn't shrink enough, use a free defrag tool like MyDefrag to defrag and move the files to the start of the partition.


  2. Use gparted from the Ubuntu live install media. This is probably the easier way to do it.



Create a new partition



Create the Ubuntu live installation media and use it to boot your computer. Choose Try Ubuntu.



Plug in the external hard drive. Start the program gparted. If you have not already shrunk the partition on the external HD, do it now.



In most cases, the internal HD will show up as sda and the external as sdb, but this is not guaranteed. Be sure you are looking at the correct HD in gparted.



Shrinking the partition will leave unallocated space. Use this to create a new partition. Format it to ext4. Jot down the partition number. This will be used for /.



You don't need a swap partition, but if want one, shrink the new partition by the size you want (or just make it a little smaller in the first place). Format that space to linux-swap.



Note down the numbers of the new partitions.



Run the Installer



Start the installer from the icon on the desktop or on the launcher. When asked how you want to install, choose: Somethine Else.



This will start the partitioner within the installer. This is different than gparted and may look a little intimidating to a beginner.



Carefully highlight the new partition (check the number and drive carefully) and click Change.



Follow the dialogs to a. Use the partition as ext4, b. mount to /, and c. format.



Highlight the swap partition and click Change. Choose use a linux-swap and that's all for that one.



Very important: change the installation of the bootloader to the USB HD. This will most likely be /dev/sdb. This will prevent you from overwriting the master boot record on your hard drive. (If you do this by accident, it's easily fixed).



Double-check your partition choices, then click Install Now.





That's it. To run Ubuntu, boot the computer with the USB plugged in. Set your bios order or otherwise move USB HD to the first boot position. The boot menu on the usb will show you both Ubuntu (on the external drive) and Windows (on the internal drive). Choose the one you want. If you boot without the usb, you will boot into Windows normally.



Ubuntu has Python 2.7 installed by default. To install the C comiler, open the terminal, any run:



sudo apt-get install gcc


or



sudo apt-get install build-essential


(if you want some additional programs helpful for C programming).





To run Ubuntu in a virtual machine instead, install VirtualBox or VMWarePlayer in Windows. Both are free. Create a new VM and use the installer media to install to the VM. But this time, don't worry about partitions. Choose Install Ubuntu to the entire virtual drive. This doesn't affect the rest of the hard drive.



If you want to put the VM on the external hd, be sure to override the default location when creating the VM and put it on a folder on the external drive.



Creating your installation media with persistence through a Windows program like LiveUSBCreator will also work, but this option will be very slow.






share|improve this answer



















  • 1





    The Ubuntu 18.04 installer broke grub on my internal hard drive even though I chose installation of the bootloader to the USB hard drive, as advised in these instructions. I needed to run boot repair to recover.

    – Communicative Algebra
    Jun 7 '18 at 6:12


















31














A very detailed answer would be beyond the scope of a single question, but here's the general outline. It's very easy, but success will partly depend on the ability of your computer to boot from an external hard drive. This depends on the bios.



Before starting, make sure your bios has an option to boot from a USB HD.



If all you need is the basic install, Python 2.7, and the C compiler, you can get away with installing Ubuntu to a fairly small partition. I forget the literal minimum Ubuntu needs to install, but it's roughly 8 GB. I would recommend 10 GB as a minimum, plus another 2-4 GB if you want a swap drive.



Create space for a partition



It's best in your case to create the new partition before doing the install. You will need to shrink the existing partition on your external hard drive first.



I would recommend backing up the USB HD; but if you had a second one, you could just install to that one. Depending on how full the drive is, you may not be able to back it completely; but try at least back up any important files. This is just a general warning and precaution since your data should be safe.



You have two options to shrink the existing partition:




  1. Use the Windows partition manager in administrative tools. I believe these are available in Home Premium. If the partition won't shrink by enough, you may need to delete files to make room. If you have more than enough available but it still doesn't shrink enough, use a free defrag tool like MyDefrag to defrag and move the files to the start of the partition.


  2. Use gparted from the Ubuntu live install media. This is probably the easier way to do it.



Create a new partition



Create the Ubuntu live installation media and use it to boot your computer. Choose Try Ubuntu.



Plug in the external hard drive. Start the program gparted. If you have not already shrunk the partition on the external HD, do it now.



In most cases, the internal HD will show up as sda and the external as sdb, but this is not guaranteed. Be sure you are looking at the correct HD in gparted.



Shrinking the partition will leave unallocated space. Use this to create a new partition. Format it to ext4. Jot down the partition number. This will be used for /.



You don't need a swap partition, but if want one, shrink the new partition by the size you want (or just make it a little smaller in the first place). Format that space to linux-swap.



Note down the numbers of the new partitions.



Run the Installer



Start the installer from the icon on the desktop or on the launcher. When asked how you want to install, choose: Somethine Else.



This will start the partitioner within the installer. This is different than gparted and may look a little intimidating to a beginner.



Carefully highlight the new partition (check the number and drive carefully) and click Change.



Follow the dialogs to a. Use the partition as ext4, b. mount to /, and c. format.



Highlight the swap partition and click Change. Choose use a linux-swap and that's all for that one.



Very important: change the installation of the bootloader to the USB HD. This will most likely be /dev/sdb. This will prevent you from overwriting the master boot record on your hard drive. (If you do this by accident, it's easily fixed).



Double-check your partition choices, then click Install Now.





That's it. To run Ubuntu, boot the computer with the USB plugged in. Set your bios order or otherwise move USB HD to the first boot position. The boot menu on the usb will show you both Ubuntu (on the external drive) and Windows (on the internal drive). Choose the one you want. If you boot without the usb, you will boot into Windows normally.



Ubuntu has Python 2.7 installed by default. To install the C comiler, open the terminal, any run:



sudo apt-get install gcc


or



sudo apt-get install build-essential


(if you want some additional programs helpful for C programming).





To run Ubuntu in a virtual machine instead, install VirtualBox or VMWarePlayer in Windows. Both are free. Create a new VM and use the installer media to install to the VM. But this time, don't worry about partitions. Choose Install Ubuntu to the entire virtual drive. This doesn't affect the rest of the hard drive.



If you want to put the VM on the external hd, be sure to override the default location when creating the VM and put it on a folder on the external drive.



Creating your installation media with persistence through a Windows program like LiveUSBCreator will also work, but this option will be very slow.






share|improve this answer



















  • 1





    The Ubuntu 18.04 installer broke grub on my internal hard drive even though I chose installation of the bootloader to the USB hard drive, as advised in these instructions. I needed to run boot repair to recover.

    – Communicative Algebra
    Jun 7 '18 at 6:12
















31












31








31







A very detailed answer would be beyond the scope of a single question, but here's the general outline. It's very easy, but success will partly depend on the ability of your computer to boot from an external hard drive. This depends on the bios.



Before starting, make sure your bios has an option to boot from a USB HD.



If all you need is the basic install, Python 2.7, and the C compiler, you can get away with installing Ubuntu to a fairly small partition. I forget the literal minimum Ubuntu needs to install, but it's roughly 8 GB. I would recommend 10 GB as a minimum, plus another 2-4 GB if you want a swap drive.



Create space for a partition



It's best in your case to create the new partition before doing the install. You will need to shrink the existing partition on your external hard drive first.



I would recommend backing up the USB HD; but if you had a second one, you could just install to that one. Depending on how full the drive is, you may not be able to back it completely; but try at least back up any important files. This is just a general warning and precaution since your data should be safe.



You have two options to shrink the existing partition:




  1. Use the Windows partition manager in administrative tools. I believe these are available in Home Premium. If the partition won't shrink by enough, you may need to delete files to make room. If you have more than enough available but it still doesn't shrink enough, use a free defrag tool like MyDefrag to defrag and move the files to the start of the partition.


  2. Use gparted from the Ubuntu live install media. This is probably the easier way to do it.



Create a new partition



Create the Ubuntu live installation media and use it to boot your computer. Choose Try Ubuntu.



Plug in the external hard drive. Start the program gparted. If you have not already shrunk the partition on the external HD, do it now.



In most cases, the internal HD will show up as sda and the external as sdb, but this is not guaranteed. Be sure you are looking at the correct HD in gparted.



Shrinking the partition will leave unallocated space. Use this to create a new partition. Format it to ext4. Jot down the partition number. This will be used for /.



You don't need a swap partition, but if want one, shrink the new partition by the size you want (or just make it a little smaller in the first place). Format that space to linux-swap.



Note down the numbers of the new partitions.



Run the Installer



Start the installer from the icon on the desktop or on the launcher. When asked how you want to install, choose: Somethine Else.



This will start the partitioner within the installer. This is different than gparted and may look a little intimidating to a beginner.



Carefully highlight the new partition (check the number and drive carefully) and click Change.



Follow the dialogs to a. Use the partition as ext4, b. mount to /, and c. format.



Highlight the swap partition and click Change. Choose use a linux-swap and that's all for that one.



Very important: change the installation of the bootloader to the USB HD. This will most likely be /dev/sdb. This will prevent you from overwriting the master boot record on your hard drive. (If you do this by accident, it's easily fixed).



Double-check your partition choices, then click Install Now.





That's it. To run Ubuntu, boot the computer with the USB plugged in. Set your bios order or otherwise move USB HD to the first boot position. The boot menu on the usb will show you both Ubuntu (on the external drive) and Windows (on the internal drive). Choose the one you want. If you boot without the usb, you will boot into Windows normally.



Ubuntu has Python 2.7 installed by default. To install the C comiler, open the terminal, any run:



sudo apt-get install gcc


or



sudo apt-get install build-essential


(if you want some additional programs helpful for C programming).





To run Ubuntu in a virtual machine instead, install VirtualBox or VMWarePlayer in Windows. Both are free. Create a new VM and use the installer media to install to the VM. But this time, don't worry about partitions. Choose Install Ubuntu to the entire virtual drive. This doesn't affect the rest of the hard drive.



If you want to put the VM on the external hd, be sure to override the default location when creating the VM and put it on a folder on the external drive.



Creating your installation media with persistence through a Windows program like LiveUSBCreator will also work, but this option will be very slow.






share|improve this answer













A very detailed answer would be beyond the scope of a single question, but here's the general outline. It's very easy, but success will partly depend on the ability of your computer to boot from an external hard drive. This depends on the bios.



Before starting, make sure your bios has an option to boot from a USB HD.



If all you need is the basic install, Python 2.7, and the C compiler, you can get away with installing Ubuntu to a fairly small partition. I forget the literal minimum Ubuntu needs to install, but it's roughly 8 GB. I would recommend 10 GB as a minimum, plus another 2-4 GB if you want a swap drive.



Create space for a partition



It's best in your case to create the new partition before doing the install. You will need to shrink the existing partition on your external hard drive first.



I would recommend backing up the USB HD; but if you had a second one, you could just install to that one. Depending on how full the drive is, you may not be able to back it completely; but try at least back up any important files. This is just a general warning and precaution since your data should be safe.



You have two options to shrink the existing partition:




  1. Use the Windows partition manager in administrative tools. I believe these are available in Home Premium. If the partition won't shrink by enough, you may need to delete files to make room. If you have more than enough available but it still doesn't shrink enough, use a free defrag tool like MyDefrag to defrag and move the files to the start of the partition.


  2. Use gparted from the Ubuntu live install media. This is probably the easier way to do it.



Create a new partition



Create the Ubuntu live installation media and use it to boot your computer. Choose Try Ubuntu.



Plug in the external hard drive. Start the program gparted. If you have not already shrunk the partition on the external HD, do it now.



In most cases, the internal HD will show up as sda and the external as sdb, but this is not guaranteed. Be sure you are looking at the correct HD in gparted.



Shrinking the partition will leave unallocated space. Use this to create a new partition. Format it to ext4. Jot down the partition number. This will be used for /.



You don't need a swap partition, but if want one, shrink the new partition by the size you want (or just make it a little smaller in the first place). Format that space to linux-swap.



Note down the numbers of the new partitions.



Run the Installer



Start the installer from the icon on the desktop or on the launcher. When asked how you want to install, choose: Somethine Else.



This will start the partitioner within the installer. This is different than gparted and may look a little intimidating to a beginner.



Carefully highlight the new partition (check the number and drive carefully) and click Change.



Follow the dialogs to a. Use the partition as ext4, b. mount to /, and c. format.



Highlight the swap partition and click Change. Choose use a linux-swap and that's all for that one.



Very important: change the installation of the bootloader to the USB HD. This will most likely be /dev/sdb. This will prevent you from overwriting the master boot record on your hard drive. (If you do this by accident, it's easily fixed).



Double-check your partition choices, then click Install Now.





That's it. To run Ubuntu, boot the computer with the USB plugged in. Set your bios order or otherwise move USB HD to the first boot position. The boot menu on the usb will show you both Ubuntu (on the external drive) and Windows (on the internal drive). Choose the one you want. If you boot without the usb, you will boot into Windows normally.



Ubuntu has Python 2.7 installed by default. To install the C comiler, open the terminal, any run:



sudo apt-get install gcc


or



sudo apt-get install build-essential


(if you want some additional programs helpful for C programming).





To run Ubuntu in a virtual machine instead, install VirtualBox or VMWarePlayer in Windows. Both are free. Create a new VM and use the installer media to install to the VM. But this time, don't worry about partitions. Choose Install Ubuntu to the entire virtual drive. This doesn't affect the rest of the hard drive.



If you want to put the VM on the external hd, be sure to override the default location when creating the VM and put it on a folder on the external drive.



Creating your installation media with persistence through a Windows program like LiveUSBCreator will also work, but this option will be very slow.







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 12 '14 at 1:26









chaskeschaskes

13.1k74159




13.1k74159








  • 1





    The Ubuntu 18.04 installer broke grub on my internal hard drive even though I chose installation of the bootloader to the USB hard drive, as advised in these instructions. I needed to run boot repair to recover.

    – Communicative Algebra
    Jun 7 '18 at 6:12
















  • 1





    The Ubuntu 18.04 installer broke grub on my internal hard drive even though I chose installation of the bootloader to the USB hard drive, as advised in these instructions. I needed to run boot repair to recover.

    – Communicative Algebra
    Jun 7 '18 at 6:12










1




1





The Ubuntu 18.04 installer broke grub on my internal hard drive even though I chose installation of the bootloader to the USB hard drive, as advised in these instructions. I needed to run boot repair to recover.

– Communicative Algebra
Jun 7 '18 at 6:12







The Ubuntu 18.04 installer broke grub on my internal hard drive even though I chose installation of the bootloader to the USB hard drive, as advised in these instructions. I needed to run boot repair to recover.

– Communicative Algebra
Jun 7 '18 at 6:12















8














Ubuntu can, and does, run well entirely from an external hard drive. I have used Ubuntu this way for years. It doesn't affect Windows. There's nothing special about installing to USB drives. You connect the USB drive, boot using a CD or an pen drive, and choose the external disk when it comes to selecting the installation location.



However:



You will have partition the external hard disk. I assume your external disk has a single partition with an NTFS filesystem. The best thing to do is shrink this partition by about 20 GB (which is more than enough for Ubuntu) and create new partitions there. This is not as difficult as it sounds (and you'd have to worry about partitions if you wanted to install another copy of Windows too).



Either use Windows' Disk Management tool to shrink the partition, or use GParted from the Ubuntu Live mode. Using the former is quicker, but limits you to whatever space is available after the last used sector in the partition (which can be very low, even if you have plenty of free space). Using the second can be very slow, especially if the partition is large, but lets you extract most of the free space.



In either case, after you get the free space, use GParted to create an extended partition there and within that extended partition, an ext4 partition. Install Ubuntu to this partition. Choose your external hard disk as the device for GRUB (bootloader) installation as well.



Alternative:



If you have a pendrive handy, use UNetBootin or Universal USB Installer or some such tool to create a bootable Ubuntu drive with persistence. If persistence is enabled, your settings and other changes to Ubuntu that you make when in Live mode don't vanish when you restart. It's ideal for low usage scenarios. You can install Python or anything else and get comfortable with Ubuntu, and then, whenever you feel ready, install Ubuntu. Note that changes made in the live mode do not affect any installation you make with it.






share|improve this answer



















  • 1





    2016, Unetbootin, Universal and other syslinux type installers are not working with 14,04 and later persistent installs. Grub2 type installers that do work for persistent partitions on thumb drives do not seem to be working for USB hard drives, even with casper-rw files or partitions.

    – C.S.Cameron
    Dec 7 '16 at 4:39











  • mkusb, help.ubuntu.com/community/mkusb, can create a persistent live drive in USB hard drives and SSD drives in external boxes with USB or eSATA connections. But the original poster wanted to keep all current files in the target drive, and mkusb will overwrite the partition table and create a new one. So it would not be an option for this case unless those data are backed up to another drive and restored after the persistent live system is installed.

    – sudodus
    May 4 '17 at 16:25
















8














Ubuntu can, and does, run well entirely from an external hard drive. I have used Ubuntu this way for years. It doesn't affect Windows. There's nothing special about installing to USB drives. You connect the USB drive, boot using a CD or an pen drive, and choose the external disk when it comes to selecting the installation location.



However:



You will have partition the external hard disk. I assume your external disk has a single partition with an NTFS filesystem. The best thing to do is shrink this partition by about 20 GB (which is more than enough for Ubuntu) and create new partitions there. This is not as difficult as it sounds (and you'd have to worry about partitions if you wanted to install another copy of Windows too).



Either use Windows' Disk Management tool to shrink the partition, or use GParted from the Ubuntu Live mode. Using the former is quicker, but limits you to whatever space is available after the last used sector in the partition (which can be very low, even if you have plenty of free space). Using the second can be very slow, especially if the partition is large, but lets you extract most of the free space.



In either case, after you get the free space, use GParted to create an extended partition there and within that extended partition, an ext4 partition. Install Ubuntu to this partition. Choose your external hard disk as the device for GRUB (bootloader) installation as well.



Alternative:



If you have a pendrive handy, use UNetBootin or Universal USB Installer or some such tool to create a bootable Ubuntu drive with persistence. If persistence is enabled, your settings and other changes to Ubuntu that you make when in Live mode don't vanish when you restart. It's ideal for low usage scenarios. You can install Python or anything else and get comfortable with Ubuntu, and then, whenever you feel ready, install Ubuntu. Note that changes made in the live mode do not affect any installation you make with it.






share|improve this answer



















  • 1





    2016, Unetbootin, Universal and other syslinux type installers are not working with 14,04 and later persistent installs. Grub2 type installers that do work for persistent partitions on thumb drives do not seem to be working for USB hard drives, even with casper-rw files or partitions.

    – C.S.Cameron
    Dec 7 '16 at 4:39











  • mkusb, help.ubuntu.com/community/mkusb, can create a persistent live drive in USB hard drives and SSD drives in external boxes with USB or eSATA connections. But the original poster wanted to keep all current files in the target drive, and mkusb will overwrite the partition table and create a new one. So it would not be an option for this case unless those data are backed up to another drive and restored after the persistent live system is installed.

    – sudodus
    May 4 '17 at 16:25














8












8








8







Ubuntu can, and does, run well entirely from an external hard drive. I have used Ubuntu this way for years. It doesn't affect Windows. There's nothing special about installing to USB drives. You connect the USB drive, boot using a CD or an pen drive, and choose the external disk when it comes to selecting the installation location.



However:



You will have partition the external hard disk. I assume your external disk has a single partition with an NTFS filesystem. The best thing to do is shrink this partition by about 20 GB (which is more than enough for Ubuntu) and create new partitions there. This is not as difficult as it sounds (and you'd have to worry about partitions if you wanted to install another copy of Windows too).



Either use Windows' Disk Management tool to shrink the partition, or use GParted from the Ubuntu Live mode. Using the former is quicker, but limits you to whatever space is available after the last used sector in the partition (which can be very low, even if you have plenty of free space). Using the second can be very slow, especially if the partition is large, but lets you extract most of the free space.



In either case, after you get the free space, use GParted to create an extended partition there and within that extended partition, an ext4 partition. Install Ubuntu to this partition. Choose your external hard disk as the device for GRUB (bootloader) installation as well.



Alternative:



If you have a pendrive handy, use UNetBootin or Universal USB Installer or some such tool to create a bootable Ubuntu drive with persistence. If persistence is enabled, your settings and other changes to Ubuntu that you make when in Live mode don't vanish when you restart. It's ideal for low usage scenarios. You can install Python or anything else and get comfortable with Ubuntu, and then, whenever you feel ready, install Ubuntu. Note that changes made in the live mode do not affect any installation you make with it.






share|improve this answer













Ubuntu can, and does, run well entirely from an external hard drive. I have used Ubuntu this way for years. It doesn't affect Windows. There's nothing special about installing to USB drives. You connect the USB drive, boot using a CD or an pen drive, and choose the external disk when it comes to selecting the installation location.



However:



You will have partition the external hard disk. I assume your external disk has a single partition with an NTFS filesystem. The best thing to do is shrink this partition by about 20 GB (which is more than enough for Ubuntu) and create new partitions there. This is not as difficult as it sounds (and you'd have to worry about partitions if you wanted to install another copy of Windows too).



Either use Windows' Disk Management tool to shrink the partition, or use GParted from the Ubuntu Live mode. Using the former is quicker, but limits you to whatever space is available after the last used sector in the partition (which can be very low, even if you have plenty of free space). Using the second can be very slow, especially if the partition is large, but lets you extract most of the free space.



In either case, after you get the free space, use GParted to create an extended partition there and within that extended partition, an ext4 partition. Install Ubuntu to this partition. Choose your external hard disk as the device for GRUB (bootloader) installation as well.



Alternative:



If you have a pendrive handy, use UNetBootin or Universal USB Installer or some such tool to create a bootable Ubuntu drive with persistence. If persistence is enabled, your settings and other changes to Ubuntu that you make when in Live mode don't vanish when you restart. It's ideal for low usage scenarios. You can install Python or anything else and get comfortable with Ubuntu, and then, whenever you feel ready, install Ubuntu. Note that changes made in the live mode do not affect any installation you make with it.







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 12 '14 at 1:22









murumuru

1




1








  • 1





    2016, Unetbootin, Universal and other syslinux type installers are not working with 14,04 and later persistent installs. Grub2 type installers that do work for persistent partitions on thumb drives do not seem to be working for USB hard drives, even with casper-rw files or partitions.

    – C.S.Cameron
    Dec 7 '16 at 4:39











  • mkusb, help.ubuntu.com/community/mkusb, can create a persistent live drive in USB hard drives and SSD drives in external boxes with USB or eSATA connections. But the original poster wanted to keep all current files in the target drive, and mkusb will overwrite the partition table and create a new one. So it would not be an option for this case unless those data are backed up to another drive and restored after the persistent live system is installed.

    – sudodus
    May 4 '17 at 16:25














  • 1





    2016, Unetbootin, Universal and other syslinux type installers are not working with 14,04 and later persistent installs. Grub2 type installers that do work for persistent partitions on thumb drives do not seem to be working for USB hard drives, even with casper-rw files or partitions.

    – C.S.Cameron
    Dec 7 '16 at 4:39











  • mkusb, help.ubuntu.com/community/mkusb, can create a persistent live drive in USB hard drives and SSD drives in external boxes with USB or eSATA connections. But the original poster wanted to keep all current files in the target drive, and mkusb will overwrite the partition table and create a new one. So it would not be an option for this case unless those data are backed up to another drive and restored after the persistent live system is installed.

    – sudodus
    May 4 '17 at 16:25








1




1





2016, Unetbootin, Universal and other syslinux type installers are not working with 14,04 and later persistent installs. Grub2 type installers that do work for persistent partitions on thumb drives do not seem to be working for USB hard drives, even with casper-rw files or partitions.

– C.S.Cameron
Dec 7 '16 at 4:39





2016, Unetbootin, Universal and other syslinux type installers are not working with 14,04 and later persistent installs. Grub2 type installers that do work for persistent partitions on thumb drives do not seem to be working for USB hard drives, even with casper-rw files or partitions.

– C.S.Cameron
Dec 7 '16 at 4:39













mkusb, help.ubuntu.com/community/mkusb, can create a persistent live drive in USB hard drives and SSD drives in external boxes with USB or eSATA connections. But the original poster wanted to keep all current files in the target drive, and mkusb will overwrite the partition table and create a new one. So it would not be an option for this case unless those data are backed up to another drive and restored after the persistent live system is installed.

– sudodus
May 4 '17 at 16:25





mkusb, help.ubuntu.com/community/mkusb, can create a persistent live drive in USB hard drives and SSD drives in external boxes with USB or eSATA connections. But the original poster wanted to keep all current files in the target drive, and mkusb will overwrite the partition table and create a new one. So it would not be an option for this case unless those data are backed up to another drive and restored after the persistent live system is installed.

– sudodus
May 4 '17 at 16:25











0














I don't think this is fully supported via Wubi, but it can be done. I'm not entirely sure of how you plan to use it.



In the past, I've unplugged my Windows device, plugged in my external device, and just run through the install using the external (and in many cases, the only) drive. Ubuntu will install correctly and treat that drive as "a drive" - nothing special being external.



Then, rather than dealing with dual-boot and GRUB, I can just use the BIOS/uEFI options to select my preferred boot device after I reconnect my Windows drive.



There are other ways of doing it, but I've found this to be the easiest, with the absolute minimal risk to my Windows systems.






share|improve this answer



















  • 1





    I dont want open laptop and remove hard drive.

    – triwo
    Apr 12 '14 at 0:42
















0














I don't think this is fully supported via Wubi, but it can be done. I'm not entirely sure of how you plan to use it.



In the past, I've unplugged my Windows device, plugged in my external device, and just run through the install using the external (and in many cases, the only) drive. Ubuntu will install correctly and treat that drive as "a drive" - nothing special being external.



Then, rather than dealing with dual-boot and GRUB, I can just use the BIOS/uEFI options to select my preferred boot device after I reconnect my Windows drive.



There are other ways of doing it, but I've found this to be the easiest, with the absolute minimal risk to my Windows systems.






share|improve this answer



















  • 1





    I dont want open laptop and remove hard drive.

    – triwo
    Apr 12 '14 at 0:42














0












0








0







I don't think this is fully supported via Wubi, but it can be done. I'm not entirely sure of how you plan to use it.



In the past, I've unplugged my Windows device, plugged in my external device, and just run through the install using the external (and in many cases, the only) drive. Ubuntu will install correctly and treat that drive as "a drive" - nothing special being external.



Then, rather than dealing with dual-boot and GRUB, I can just use the BIOS/uEFI options to select my preferred boot device after I reconnect my Windows drive.



There are other ways of doing it, but I've found this to be the easiest, with the absolute minimal risk to my Windows systems.






share|improve this answer













I don't think this is fully supported via Wubi, but it can be done. I'm not entirely sure of how you plan to use it.



In the past, I've unplugged my Windows device, plugged in my external device, and just run through the install using the external (and in many cases, the only) drive. Ubuntu will install correctly and treat that drive as "a drive" - nothing special being external.



Then, rather than dealing with dual-boot and GRUB, I can just use the BIOS/uEFI options to select my preferred boot device after I reconnect my Windows drive.



There are other ways of doing it, but I've found this to be the easiest, with the absolute minimal risk to my Windows systems.







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 12 '14 at 0:39









K. Darien FreeheartK. Darien Freeheart

488313




488313








  • 1





    I dont want open laptop and remove hard drive.

    – triwo
    Apr 12 '14 at 0:42














  • 1





    I dont want open laptop and remove hard drive.

    – triwo
    Apr 12 '14 at 0:42








1




1





I dont want open laptop and remove hard drive.

– triwo
Apr 12 '14 at 0:42





I dont want open laptop and remove hard drive.

– triwo
Apr 12 '14 at 0:42





protected by Community Feb 26 '16 at 7:43



Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



Would you like to answer one of these unanswered questions instead?



Popular posts from this blog

flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

Mangá

 ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕