0

I'd like to full install ubuntu to a 128gb usb3 thumb drive. I'd like to prevent any chance of me jacking up the main hard drive in the latop during installation.

Is there something I can do, like unmount the hard drive to prevent it from showing up in the installer when setting up partitions? Ideally I would physically disconnect the drive, but this is not an option.

I'd also like to guarantee that no boot loaders or anything are installed on the main hard disk. Basically, I want the ubuntu installer to think the drive doesn't even exist. Everything will be installed to the thumb drive and I'll use the bios boot sequence to choose to boot from the thumb drive or the hard disk.

Thanks!

  • On many laptops, the internal hard drive is extremely easy to remove. Many hard drives are under an access cover that's only held by one screw, and the drive by two screws. Other hard drives just slide out of the side of the computer, and they're only held in by one or two screws. – heynnema Nov 19 '16 at 13:01
  • 1
    My two cents: it's more complicated to hide a drive from the installer (by means of software alone) than to use manual partitioning and establish beforehand which drive you don't want to touch during that process. If you want to know how to do the latter, please open a new question about it. – David Foerster Nov 20 '16 at 15:12

1 Answers1

1

I have to say that I would always prefer to leave the disks as they are seen by the system, choose Manual partitioning, and take care where I ask the installer to put GRUB (the system loader) and in what partitions to install the system.

However, the following procedure seems to work. Note that I have tested it only on a small virtual machine:

  1. Boot from the installation media.
  2. Choose "Try Ubuntu".
  3. Connect your USB thumb drive.
  4. Open GParted (dash button - applications lens - show all installed applications) and identify your hard disk and your USB thumb drive. Let's say that the hard disk is /dev/sda and the thumb drive is /dev/sdc. Close GParted.
  5. Open a terminal (right click on desktop, chose open terminal). In the terminal run the command sudo rm /dev/sda*, where /dev/sda is corresponds to the hard disk as identified in step 4. As far as Ubuntu knows, /dev/sda is gone.
  6. Optionally, open GParted again and notice that you can find only your USB thumb drive.
  7. Run the installer. To check that it sees only the USB thumb drive, choose Manual partitioning -- you can always go back to the type of installation screen if you want one of the automatic partitioning options.
AlexP
  • 10,197
  • No, you don't want to do that... potentially lose data from your hard disk! – heynnema Nov 19 '16 at 01:25
  • What would be the failure mode? As I said, I always prefer to tell the installer explicitly where to install, so I am curious to find out what risks you have identified. – AlexP Nov 19 '16 at 01:35
  • sudo rm /dev/sda* will remove all sda* files from the /dev directory. I'm not sure I'd want to do that. – heynnema Nov 19 '16 at 01:40
  • Why not? They are just names associated to a major:minor number, on a temporary RAM file system. – AlexP Nov 19 '16 at 01:42
  • I don't know all of the underpinnings, so I can't give you a good technical answer, I just know I wouldn't do it. Maybe one of the other experts can chime in here. – heynnema Nov 19 '16 at 01:47
  • I guess I'm just scared I'm going to accidentally blow away something on the main hard drive and the system will not be bootable. I have an old laptop that I could practice on. This is mainly because of my lack of experience with grub and boot loaders. – Spyoptix Nov 19 '16 at 03:38
  • @DavidFoerster do you have any comments that you can add to this thread? – heynnema Nov 19 '16 at 14:31
  • I agree with @heynnema: rm /dev/sda* will not remove any data from the drive behind /dev/sda; it doesn't even access that drive because /dev/sda* are just references to a data structure in the kernel used to manage that drive. So, rm /dev/sda* deletes the references but not the data structures or even on-disk data. You can restore the references with a reboot or an appropriate mknod invocation. – David Foerster Nov 20 '16 at 15:08
  • @DavidFoerster I think you agree with AlexP, not heynema? – Zanna Dec 16 '16 at 08:18
  • @Zanna: Correct. My bad. – David Foerster Dec 16 '16 at 10:12
  • @DavidFoerster thank you for clarifying :) I asked because this post has 2 delete votes, but I think it may actually be helpful. I am upvoting it now. – Zanna Dec 16 '16 at 10:17