1

Here's the scenario: I would like to use a live USB to boot up my computer sometimes and access large programs that I want to run in Ubuntu only. However, I only have access to an 8gb USB drive, and the programs I'm looking at are around 50gb and upwards. From my research, I think I have to set up persistence, but instead of saving files to my USB, I want to be able to save files to my computer without messing up my current operating system and whatnot. How do I do that?

EDIT: If I mount my hard drive, is there anything I have to do to make my programs install there, and how can I do it so that my OS settings are stored on the USB (So I can take it with me), and my large programs are still on my OS.

EDIT: Errors with mkusb

Drive that contains source file: /dev/sda
Live drive, that is booted from: /dev/sda
cands=2

 50G

 50G
built-in device
sdb
SanDisk_Cruzer_Glide
 7.5G
usb
USB or memory card
p_target: target=/dev/ 7.5G
No target device or bad target device
p_clean:
ThunderBird
  • 1,955
Led
  • 48
  • I often use NFS mounts (ie. network fs) even from 'live' media. I can mount wherever I want it; though smaller stuff I just save locally & scp to a server for storage (SaMBa/cifs could be used also, so you don't have to use a local mounted hdd/persistence). Note: 'live' uses memory for everything & installing large programs/updates can run a 'live' out of memory in my experience... – guiverc Feb 07 '18 at 07:07

2 Answers2

1

Persistent live with a casper-rw partition in the internal drive

  • You can create a persistent live drive with mkusb according to the following links,

    help.ubuntu.com/community/mkusb

    help.ubuntu.com/community/mkusb/persistent

  • Ubuntu will search for a file with the name casper-rw or a partition with the label casper-rw, and use the first one that it finds. So you can

    • remove or re-label the casper-rw partition on the USB pendrive (created by mkusb),
    • In Windows shrink the Windows partition (typically C:) and leave the freed drive space as 'unallocated'.
    • Boot live-only from the Ubuntu live drive, 'Try Ubuntu',
      • start gparted and
        • create a partition in the unallocated drive space and
        • in the partition create an ext4 file system
        • set the label casper-rw on this partition
    • Now, when you reboot the Ubuntu live drive, you should be able to boot persistent live and it will use the casper-rw partition in the internal drive. It should be possible to install your large programs and they are stored (automatically) in the casper-rw partition in the internal drive.

Test that it really works

enter image description here

As you can see in the screenshot, the casper-rw partition in the internal drive /dev/sda is 49 GiB, and it is used for persistence. The operating system is running from a [16 GB] USB pendrive /dev/sdb, where the automatically created casper-rw partition is re-labeled to casper-off.

sudodus
  • 46,324
  • 5
  • 88
  • 152
  • This is exactly what I was looking for! Thanks! I guess I have to rename my usb pendrive from casper-rw and back each time I want to use it on a different computer. – Led Feb 07 '18 at 07:44
  • It is enough to re-label the casper-rw partition in the USB pendrive. I tested that it really works with a Lubuntu system (and I will add a screenshot to the answer). – sudodus Feb 07 '18 at 07:54
  • Also, do i have to partition the c drive in windows, or can i do it once i'm in ubuntu? – Led Feb 07 '18 at 08:07
  • It is much safer to shrink the C: partition and the NTFS file system with Windows, and after that use Ubuntu to create a partition in it. 'Manage Windows file systems with Windows tools, and linux file systems with linux tools'. – sudodus Feb 07 '18 at 08:09
  • I tried using mkusb, but I'm having the same problem as in this post: https://askubuntu.com/questions/899341/mkusb-fails-to-make-persistant-usb I'm also using a sandisk usb, but only with 7.5gb. I get the same errors for both live installation and persistant. I'm using Ubuntu 17.10 – Led Feb 07 '18 at 08:16
  • I will try to debug your problem. 1. Which version of Ubuntu are you running (the operating system, where you have installed mkusb)? 2. Which version of mkusb are you running? 2. What computer is it (brand name and model)? 4. Is there a floppy drive in the computer? If not, it is probably another problem with similar symptoms. 5. Please edit your original question to post the exact error output. Indent each line 4 spaces in order to render the output as 'code'. – sudodus Feb 07 '18 at 08:24
  • Ubuntu 17.10 2. Dus 12.2.9 3. Hp omen (through a virtual machine I'm accessing ubuntu with vmware workstation 12 4. The floppy drive is in the computer, but is mounted through the virtual machine. This might be the cause of the problem, in that case no worries, since I can just make one without partitioning.
  • – Led Feb 07 '18 at 08:29
  • I have not tested mkusb with vmware. (I have tested it with virtualbox, and it works.) Probably there is a problem with some drive specification in vmware, that I never had a chance to debug. Please try in another system and let me know if it works. If not, I can suggest alternatives ... – sudodus Feb 07 '18 at 08:34
  • That's alright, I also have virtualbox, so I'll see if I can work it out there, but so far you've answered everything I wanted to know, so thank you so much. – Led Feb 07 '18 at 08:37
  • I saw the error output (in the edited original question), and I agree, that it is very similar to the error in the link you show in a previous comment. (I am thinking of a questionmark: I tested in virtualbox with an earlier version of Ubuntu (not 17.10) and probably also and earlier version of virtualbox, but I run mkusb 'all the time' in 17.10 installed in bare metal ...). Good luck :-) – sudodus Feb 07 '18 at 08:43
  • Actually, virtualbox managed to make the usb, but even after editting the bios it won't boot up ubuntu. So i am stuck with a regular, non persistent usb. As such, how to I make it automatically detect the internal casper partition I made? It seems like i have to mount it every time, and even then it just has my files but not my ubuntu settings. – Led Feb 07 '18 at 23:57
  • @Led, Are you trying to boot a virtual machine from USB? Can you boot another computer from the USB drive made by mkusb? 1. Maybe you can use the 'Do It Yourself' method described in the following links, https://help.ubuntu.com/community/Installation/iso2usb and https://help.ubuntu.com/community/Installation/iso2usb/diy ; 2. another alternative is to add the boot option persistent to your 'non-persistent USB'. See http://ubuntuforums.org/showthread.php?t=2230389&p=13370808#post13370808 and https://help.ubuntu.com/community/mkusb/sp – sudodus Feb 08 '18 at 07:20