7

Background: I installed Ubuntu 20.04 successful to the pen drive. Everything works fine. Nvidia drivers and AMD drivers install without a problem and the system works fine. I want to use this drive to take around with me as my own personal OS.

Problem: After I restart my PC and boot from the pen drive on my own PC the drivers for NVIDIA will not load and I am left with a black screen with an X as my cursor. Upon going into recovery mode I can login and see the screen again. However, this is with the open source drivers and I need the NVIDIA drivers for some compute tasks at home (mainly faster GPU mining).

What I tried: I tried editing the grub file to load the Nvidia driver and it still would give me a black screen with an X as my cursor. I tried editing the boot parameters to no avail. Probably lack of knowledge on my end. I don't want this to be a problem if I were to switch systems say to and AMD another NVIDIA system or something else.

What I would like: I'd like to make 3 boot options. One for NVIDIA, one for AMD and one that will load the open source drivers. I know it's possible but the question is how?

Thanks for taking the time to read this!

1
  • 1
    It can be tricky, when you need different graphics drivers and at least one of them is a proprietary driver. In your case the nvidia driver is proprietary. One method is to have separate Ubuntu systems alongside each other, which is OK when there is enough drive space (See also the answer by @Irsu85.) A common data partition on the pendrive helps you share the space for data storage between the different operating systems. You can also share the home partition as suggested by C.S.Cameron. – sudodus Jun 5 at 9:43
8

Ubuntu 20.04 USB that boots both BIOS and UEFI with Nvidia, AMD and Standard GPU Drivers. Step by Step

  1. Create Full Install of Ubuntu 20.04 to USB that works in both BIOS and UEFI modes using the procedure at this link: https://askubuntu.com/a/1217839/43926.

  2. Create the Data and two boot partitions as shown. Make the / partition about 20GB. Be sure to use the option for separate /home partition. Make it about 50GB. Leave remaining space empty.

  3. After installation set up OS as desired with all programs and apps needed. Do not install any proprietary graphics drivers.

  4. Boot Live Ubuntu USB, (or GParted USB), and start GParted.

  5. Right click the / partition of the USB and select Copy.

  6. Right click the empty space and select Paste. Repeat to create the third OS partition. Click Apply All Operations.

  7. Expand the NTFS or Fat32 Data partition(s) for sharing with Windows or Apple. Click Apply All Operations.

  8. Right click one of the OS partitions and select New UUID. Repeat to change the next OS partition UUID. Click Apply All Operations.

GParted

  1. Close GParted and reboot.

  2. In Terminal run sudo update-grub.

  3. Open Gnome-Disks and mount the partitions with new UUID's.

  4. Start Nautilus using sudo -H nautilus.

  5. Edit /etc/fstab of each OS partition to change the UUID as shown in Disks.

  6. Edit sdx4 boot/grub/grub.cfg to correct the UUID's on the linux ... lines if needed.

  7. Copy grub.cfg to sdx3 boot/grub/grub.cfg one more time.

  8. Boot each OS and install proprietary GPU drivers as you wish.

  9. Test.

Check completed.

8
  • @sudodus: Do you think this will work? It should save a lot of duplication. – C.S.Cameron Jun 5 at 13:08
  • Yes I think it will work, but I'm glad that you have decided to check it tomorrow. Maybe you have forgotten something. - On the other hand, I am not sure that it will be easier (maybe somewhat faster) compared to installing all three systems with the standard installer from the live system. – sudodus Jun 5 at 13:17
  • 1
    For me cloning an OS with GParted is quite a bit faster than installing from scratch, Fresh installs to USB using my old computers take about an hour or longer, a clone about 25 minutes. but I was also thinking about the time to install duplicate programs and apps. I spend a lot of time trying to remember what I have already done :-( – C.S.Cameron Jun 5 at 13:27
  • Anyway, I am looking forward to the result of your efforts tomorrow, and I wish you good luck :-) You may have a point about cloning as a much faster method, particularly in USB pendrives that are relatively fast writing a single big file, but [often] slow writing many small files. (The difference in speed for one big file versus many small files is smaller in SSDs.) – sudodus Jun 5 at 13:40
  • 1
    @sudodus: I found the problem was a bad UUID in one of the menuentries. All seems good now. I have only tested it with and without Nvidia drivers, I don't have an AMD computer for testing. I will edit answer with warning about UUID check. – C.S.Cameron Jun 7 at 4:35
4

Sharing /home Partition

As Irsu85 noted, you can install the same version of Ubuntu to a pendrive multiple times.

You can also create a /home partition and share it between all of the installs as long as they are the same flavour and version. The experience with each install should then be the same.

I would start with a minimum of 20GB for each / partition and about 50GB for the /home partition.

Use any remaining space for an NTFS Data partition, if you will be sharing data with a Windows computer or FAT32 if sharing with an Apple computer.

Installation should be straight forward. GRUB from the final install should include each Ubuntu install in the boot menu, if not, just run sudo update-grub.

2
  • 1
    Sharing home is a good idea, if the systems are the same version (e.g. 20.04.x LTS) and flavour (e.g. standard Ubuntu or Lubuntu). Maybe add that if the user wants to share data with Windows, it can be a good idea to add a usbdata partition with the file system NTFS. – sudodus Jun 5 at 10:02
  • @sudodus: good idea, thanks. – C.S.Cameron Jun 5 at 10:12
1

You can install multiple instances of Ubuntu by just running the installer again and make the partition for the other ubuntu installation smaller. Then install grub customizer on one instance to rename the different ubuntu installation in GRUB.

If you need more info, please comment

Thanks

Irsu85

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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