A person has a computer with no HDD but 16GB RAM and USB3 port.

Also has 16GB USB3 pendrive with Ubuntu Live on it, (Non persistent).

The computer is then started with the pendrive using toram.

The pendrive is then removed and reinserted while the O/S is running.

Is the O/S that is running in RAM able to do a "Full" install to the pendrive?

This was asked in:

Can I install Ubuntu onto a USB flash drive using the SAME flash drive?

However for some reason this unique question was marked as "Duplicate".

  • 2
    I think so. When the content of the boot drive is copied to ram, it is no longer mounted (and can be removed). Then it depends on the installer, if it understands the situation or 'remembers' from where it was booted. I have not tried, but I would be very happy to know. Please try and share your experience :-) (This case is different from a persistent live system with the casper-rw partition on the boot drive as you hint in your question.) – sudodus Nov 29 '16 at 18:39
  • Thank you Sudodus, I am a little worried about yanking the pendrive if it is being written to, perhaps OK if it is non-persistent. – C.S.Cameron Nov 30 '16 at 1:55
  • 1
    Yes a non-persistent pendrive. I don't think you would destroy the pendrive itself, probably the worst case is that the partition table or file system would be borked, but it can be fixed after wiping the first megabyte with mkusb :-) – sudodus Nov 30 '16 at 5:14
  • I didn't yank it, only rebooted :-) – sudodus Nov 30 '16 at 10:09
up vote 5 down vote accepted

I was too curious to wait for you to check if it works. So I tried and here is my result:

Yes, it works with the following recipe :-)

  • Create a live-only drive by cloning ubuntu-16.04.1-desktop-amd64.iso to a 32 GB USB 3 pendrive with mkusb

  • Add the boot option toram and boot

  • When running live, unmount all mounted partitions in the pendrive (in this case it was only one), run in a terminal window

    sudo umount /media/{and press the TAB key for 'tab completion'}
    # or
    sudo mount /media/*/*  # if more than one partition
    

    Check that all partitions on the pendrive are unmounted with

    df
    
  • Start the installer with the desktop icon

  • Follow the instructions like any other installation

  • Reboot

I did it in a laptop computer with 4 GiB RAM in BIOS mode without any internal drive.

If there is an internal drive, things may be more tricky in order to avoid writing bootloading things to the internal drive, but this is not due to the fact that it is installed to the same drive as the system was booted from.

-o-

Edit 1: I tested in UEFI mode. The final 'Reboot' got stuck at the plymouth 'five dots'.

  • I waited for a couple of minutes and could finish gracefully with SysRq r e i s u b

and when rebooted, the installed system works. A better alternative is to

  • 'Continue testing' instead of reboot

  • Flush the buffers in a terminal window

    sync
    
  • Reboot the live system

and it finishes and reboots beautifully.

-o-

Edit 2: You find help how to add the boot option toram at this link,

How to unmount a live DVD/USB?

  • Well done Sudodus, I have not seen this solution posted anywhere on the Internet. And to think the answer might have been lost due to the overzealousness of the Duplicate Post Police on the referenced question. I hope they eventually learn to read both questions before calling one a duplicate. – C.S.Cameron Dec 1 '16 at 3:44

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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