Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Bootable USB Linux on EFI/UEFI


  • Please log in to reply
88 replies to this topic

#1 The Man from Oahu

The Man from Oahu

  • Members
  • 192 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:07:03 PM

Posted 01 July 2015 - 09:52 AM

Hi guys,

not sure if to post this here, I hope it's the right place.
I am trying to put Linux Mint (with persistence) on a 8GB USB thumb drive.
This is what I usually do in GParted:
- delete all the partitions on the thumb drive
- create a first FAT32 partition (let's say 1.5GB)
- install Linux Mint with persistence (using tools like Unetbootin) and flag the partition as "boot"
- use all the remaining space on the device to create a ext2 partition labelled "casper-rw"
- delete the "casper-rw" file on the FAT32 partition
This give me a bootable USB drive with Linux and as much room for persistence as I have on the device.

The problem is such USB drive doesn't boot on my new PC (W7 installed on SSD).
As far as I understand it doesn't work because of the EFI/UEFI.

After reading around I tried this procedure:
- deleted all the partitions on the thumb drive
- in GParted -> Device -> Create Partition Table -> GPT
- created a 1.5GB FAT32 partition. It was flagged as "msftdata", I changed it to "boot"
- mounted the Linux Mint ISO and copied all the files into that partition
- created the ext2 partition and labelled it "casper-rw"

I haven't tested it yet but I have some questions:
- there is no "casper-rw" file (the persistence file) to delete in the FAT32 partition. Is this a persistent Linux or not?
- it is very important that my machine remains exactly as it is. Assuming this thumb drive boots, will it change anything on the PC?

Just to be clear: I am not interested in a dual-boot system, I only need to run Linux from the thumb drive.

Thanks for your help.



BC AdBot (Login to Remove)

 


m

#2 cat1092

cat1092

    Bleeping Cat


  • BC Advisor
  • 6,887 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:North Carolina, USA
  • Local time:01:03 PM

Posted 02 July 2015 - 01:02 AM

What you may need to do, if you haven't already, is to disable Secure Boot for this, as I had to just to make my Macrium Reflect backup/restore Flash drive bootable on this type of system. 

 

Then you may can do what you want to. It is imperative though, since you mention that you don't want a dual boot system, to ensure during the formatting stage, to place the bootloader on the Flash device. This can be seen from the drop down list during the formatting options & will prevent you from any possible overwrite to your system, assuming a regular install. 

 

Another possibility is to use the Universal USB installer to set it up, you can set your persistence file during the process & this won't mess up your boot, as it knows where to place the files. 

 

http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/

 

For an 8GB Flash drive, this is the easiest solution & the one I use to create all of my bootable Linux OS installers, though I should warn not to accept updates that's not needed, otherwise the persistence file will fill fast. 

 

There is also Rufus, I've tested this on a UEFI system, there's the option to create a bootable drive for both UEFI & MBR systems. That's how I created my Macrium Reflect backup/rescue Flash drive for the computer. 

 

With an 8GB Flash drive, and the limitation of a 4GB persistence file, you'll have a bootable drive, just can't save a lot of data on it. If you have a 16GB Flash drive, could perform a Full install, which lifts the limits of a persistence file. And for safety, you can temporarily remove your HDD, to prevent any chance of overwriting the bootloader during install. Though keep in mind that with certain models of computers with UEFI, there's the chance of having a 'bricked' computer. Since you didn't provide any computer specs, you can post what you have & we can research, or you can research your own model, we're always happy to assist. :) 

 

In particular, many Samsung models are notorious for this, yet this isn't limited to that brand only. My suggestion is to check for Linux compatibility before doing anything, as it's best to be safe than sorry, and the OEM warranty doesn't cover this type of repair. 

 

Good Luck! :thumbup2:

 

Cat


Edited by cat1092, 02 July 2015 - 01:04 AM.

Performing full disc images weekly and keeping important data off of the 'C' drive as generated can be the best defence against Malware/Ransomware attacks, as well as a wide range of other issues. 


#3 NickAu

NickAu

    Bleepin' Fish Doctor


  • Moderator
  • 11,708 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:127.0.0.1 Australia
  • Local time:05:03 AM

Posted 02 July 2015 - 01:27 AM

 

it is very important that my machine remains exactly as it is. Assuming this thumb drive boots, will it change anything on the PC?

Nothing will change on your machine.

 

Did Windows 7 machines have secure boot?

 

Was grub installed?

 

You can also install Linux to USB just like you can on HDD.



#4 cat1092

cat1092

    Bleeping Cat


  • BC Advisor
  • 6,887 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:North Carolina, USA
  • Local time:01:03 PM

Posted 02 July 2015 - 02:18 AM

 

 

Did Windows 7 machines have secure boot?

 

Thanks for the reminder, Nick! :thumbup2:

 

No Secure Boot for Windows 7, so that's out of the picture. 

 

A couple of years back, Linux didn't need as much space, now Linux MInt installs says somewhere around 8.6GiB is needed, subtract the space for formatting the 8GiB Flash drive, you're still going to be 1GiB or more short for a Full install & these drives doesn't perform well when cramped for space & will impact lifespan of the device. My suggestion would be to use a 16GiB Flash drive and perform a Full install, many of these are now less than $10 on promo. 

 

You may also use a 16GiB SDHC card attached to a USB card reader, some of these are faster than USB 3.0 Flash drives. Especially the ones that's Class 10 UHS-1. Class 6 & especially 4 cards are very slow. 

 

Note that you may be limited to booting from your USB 2.0 ports, not all computers supports booting from USB 3.0. I have one that does, two that doesn't. It's my notebooks that doesn't. 

 

Cat


Performing full disc images weekly and keeping important data off of the 'C' drive as generated can be the best defence against Malware/Ransomware attacks, as well as a wide range of other issues. 


#5 The Man from Oahu

The Man from Oahu
  • Topic Starter

  • Members
  • 192 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:07:03 PM

Posted 02 July 2015 - 09:49 AM

Thanks for your replies.

I am new to W7 so I didn't get everything you wrote.
 

What you may need to do, if you haven't already, is to disable Secure Boot for this

No Secure Boot for Windows 7, so that's out of the picture

So no need to do this, right?

It is imperative though, since you mention that you don't want a dual boot system, to ensure during the formatting stage, to place the bootloader on the Flash device. This can be seen from the drop down list during the formatting options & will prevent you from any possible overwrite to your system

What utility/software this sentence is referred to?

Another possibility is to use the Universal USB installer...

I need to create the bootable USB drive from Linux Mint, UUI is for Windows (sorry, I forgot to specify it on my first post).
The same thing goes for Rufus.

With an 8GB Flash drive, and the limitation of a 4GB persistence file, you'll have a bootable drive, just can't save a lot of data on it. If you have a 16GB Flash drive, could perform a Full install, which lifts the limits of a persistence file

Following the procedure I described in the first part of my previous post I don't have any 4GB limitation, I use a partition for persistence not the casper-rw file. I am using a Live Linux Mint on a 8GB thumb drive with a persistence of 5.21GB right now.

keep in mind that with certain models of computers with UEFI, there's the chance of having a 'bricked' computer. Since you didn't provide any computer specs, you can post what you have & we can research, or you can research your own model

I built this machine myself. The MoBo is a Gigabyte H97-D3H and W7 is installed on a 128GB Crucial SSD (M500 or M550, I don't remember now). The MoBo manual lists Windows 7, 8 and 8.1 as supported OSs.

Was grub installed?

Sorry, I don't get the question.

You can also install Linux to USB just like you can on HDD

My suggestion would be to use a 16GiB Flash drive and perform a Full install

Could you list the differences between a full install and a live persistent install?

 



#6 pcpunk

pcpunk

  • Members
  • 5,276 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Florida
  • Local time:01:03 PM

Posted 02 July 2015 - 11:14 AM

Sorry I don't have much time but I would suggest the "Full USB Install" also.  Nothing wrong with what you are trying to do but I don't know enough to help you out with that.  It is way easier to just install to usb, just like you would to a pc's HDD, it's really that simple.  No messing around with persistence and such, just create your / root and home / partitions while in the installer, or just let the installer make all for you.  No need to mess about with gparted as the installer will do the same for the most part.

 

WARNING: Referring to this below, BE VERY CAREFUL not to put the bootloader onto your W7 install, wait for assistance if you need.  I believe cat1092 is referring to a Full Install to USB using the Mint Ubuntu Installer.  There is a choice in the installer as to where the bootloader goes.  That post of cat's was very good and even I will read it over again.

 

Quote

It is imperative though, since you mention that you don't want a dual boot system, to ensure during the formatting stage, to place the bootloader on the Flash device. This can be seen from the drop down list during the formatting options & will prevent you from any possible overwrite to your system

What utility/software this sentence is referred to?

 

Also just took a look at your hardware and it seems as though it does support Secureboot or UEFI, something, I don't know.  You will have to research it or wait for assistance here.

"AMI UEFI BIOS"

http://www.gigabyte.com/products/product-page.aspx?pid=4962#sp

http://www.ami.com/products/bios-uefi-firmware/


Edited by pcpunk, 02 July 2015 - 11:16 AM.

sBCcBvM.png

Created by Mike_Walsh

 

KDE, Ruler of all Distro's

eps2.4_m4ster-s1ave.aes_pcpunk_leavemehere

 


#7 The Man from Oahu

The Man from Oahu
  • Topic Starter

  • Members
  • 192 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:07:03 PM

Posted 02 July 2015 - 11:45 AM

Thanks to you too.



#8 rp88

rp88

  • Members
  • 2,895 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Local time:06:03 PM

Posted 02 July 2015 - 02:41 PM

"Though keep in mind that with certain models of computers with UEFI, there's the chance of having a 'bricked' computer"

Is there an easy way to work out which of these certain models are badly built enough that they have the risk of bricking, is there a list online anywhere of "these types will brick, and these won't"?

Thanks

Edited by rp88, 02 July 2015 - 02:42 PM.

Back on this site, for a while anyway, been so busy the last year.

My systems:2 laptops, intel i3 processors, windows 8.1 installed on the hard-drive and linux mint 17.3 MATE installed to USB

#9 The Man from Oahu

The Man from Oahu
  • Topic Starter

  • Members
  • 192 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:07:03 PM

Posted 02 July 2015 - 03:27 PM

"Though keep in mind that with certain models of computers with UEFI, there's the chance of having a 'bricked' computer"

Is there an easy way to work out which of these certain models are badly built enough that they have the risk of bricking, is there a list online anywhere of "these types will brick, and these won't"?

Thanks

 
That's an interesting question.
 
Anyway, I installed (from Linux) Linix Mint on a 16GB thumb drive, full install (not Live + persistence).
I followed the installation wizard but I didn't see any drop-down menu to choose where to place the bootloader.
This is what I got:

- sdc1 (ext4, 10.94GB (4.87GB used))

- sdc2 (extended, 3.96GB)

- - sdc5 (linux-swap, 3.96GB) (sdc5 is inside sdc2)

- 1MB unallocated

Is everything as it should?



#10 cat1092

cat1092

    Bleeping Cat


  • BC Advisor
  • 6,887 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:North Carolina, USA
  • Local time:01:03 PM

Posted 02 July 2015 - 11:44 PM

There should have been the option at the very bottom of the partition setup as to where to place the bootloader, with all installed devices in a drop down menu. You do have to click this line to see the options. Place the bootloader on that device, not a partition on it. For example, /dev/sda (a device), not /dev/sda1 or /dev/sda2, these are partitions. You should be able to distinguish your Windows drive from a Flash one from the size alone. 

 

However, since you built the computer, then the safest approach is to unplug the HDD/SDD during install, this way, nothing gets messed up. Then after the install, go into the BIOS & set that device to boot first, or after any optical media, anything as long it's before the HDD/SSD that contains the Windows Boot Loader. 

 

Be sure never to update GRUB while running this flash drive, nor upgrade to a newer release (17.2 will soon be released) while the main drive is plugged in, otherwise your MBR will be overwritten. 

 

However, frequent backup images of your main drive can also be of help, most of the time, my main OS gets two weekly images. This is in case Microsoft slides in against my will, any Windows 10 pre-updates that will trigger several actions, including placing that Windows 10 nag icon in the lower right corner. One must be prepared for the worst at all times. 

 

At any rate, the backup will also save your Windows bootloader, should be be overwritten by accident. 

 

Should you have any more questions, please don't hesitate to ask. That's why we're here. Your concern is ours until it's solved. :)

 

Cat


Edited by cat1092, 02 July 2015 - 11:45 PM.

Performing full disc images weekly and keeping important data off of the 'C' drive as generated can be the best defence against Malware/Ransomware attacks, as well as a wide range of other issues. 


#11 Guest_hollowface_*

Guest_hollowface_*

  • Guests
  • OFFLINE
  •  

Posted 03 July 2015 - 12:58 AM

In Linux Mint you should browse the ESP (EFI System Partition) partition for your Windows installation (I assume Windows 7 is installed in UEFI mode since you're doing your flashdrive this way) to see if any non-Windows folders are in there (eg: Ubuntu). If such are present then Grub installed to that drive, not your flash-drive. Even if you had selected the correct location, I find Ubuntu tends to ignore where you tell it to install Grub (when doing UEFI installs), so it's likely Linux Mint would do the same (as it's an Ubuntu derivative).

Like some of the others, I too think you're better off with a native-install rather than a live-installation (with peristence), but If you're still interested in persistence, the insructions found here: su:#FoI4db0f+5q9--y7xVbATBJ@Q15b81-325RgJ1b%y&SpVa5poLsEoSmA2-u work for me. It's for Lubuntu so you'll need to deviate a little. For example in these instructions the ESP partition is only 700MiB, but for you'll need to change that to size that is equal-to or greater-than the size of the Linux Mint ISO, or you won't have enough room for the Linux Mint disc contents.



#12 The Man from Oahu

The Man from Oahu
  • Topic Starter

  • Members
  • 192 posts
  • OFFLINE
  •  
  • Gender:Male

Posted 03 July 2015 - 11:01 AM

Thanks guys for your help.

I see I didn't make myself clear enough in my first post:
I am using an old PC (no HDD at all) with Linux Mint on a USB thumb drive.
The W7 machine is a completely different one and I only installed the OS on that. Now, working on this (old) PC I am trying to figure how to create a EFI/UEFI bootable USB to be used on the new PC when needed. I am working on the old machine because I don't want to accidentally mess up something on the new one.
 

There should have been the option at the very bottom of the partition setup as to where to place the bootloader, with all installed devices in a drop down menu

I made a test, that drop-down menu is available only if you choose to manually setup partitions on the device. I let the wizard do all the work, that's why I didn't see it the first time.

However, since you built the computer, then the safest approach is to unplug the HDD/SDD during install, this way, nothing gets messed up

See above.

At any rate, the backup will also save your Windows bootloader, should be be overwritten by accident

So with a system backup I am sitting pretty no matter what happens, am I?
 

In Linux Mint you should browse the ESP (EFI System Partition) partition for your Windows installation (I assume Windows 7 is installed in UEFI mode since you're doing your flashdrive this way) to see if any non-Windows folders are in there (eg: Ubuntu). If such are present then Grub installed to that drive, not your flash-drive

See above.

Like some of the others, I too think you're better off with a native-install rather than a live-installation (with peristence), but If you're still interested in persistence, the insructions found here: su:#FoI4db0f+5q9--y7xVbATBJ@Q15b81-325RgJ1b%y&SpVa5poLsEoSmA2-u work for me

Tbh, it looks like the procedure I described in the second half of my first post, only I used Unetbootin.

Anyway, as said I tried to full install LM on a 16GB drive and I got:
- sdc1 (ext4, 10.94GB (4.87GB used))
- sdc2 (extended, 3.96GB)
- - sdc5 (linux-swap, 3.96GB) (sdc5 inside sdc2)
- 1MB unallocated
I assume data are saved on sdc1 which is the system partition.
How do I manage to have data saved on a separate partition?

 

Edit: my mistake.

I used Unetbootin for the procedure described in the first half of my first post.

For the other one I just mounted the Linux Mint ISO and copied all the files to the FAT32 partition on the device.


Edited by The Man from Oahu, 03 July 2015 - 01:31 PM.


#13 pcpunk

pcpunk

  • Members
  • 5,276 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Florida
  • Local time:07:03 PM

Posted 03 July 2015 - 11:27 AM

Good to see you had success!  One thing you should have done is chose "Something Else" and then created your own partitions, mostly just the swap.  If you had made your swap 1gig then you would have more room for files and Updates.  I believe that you used the Mint Installer, if so you might/should post the source you used to do this.  Not all the info on the web is good, but the members here will get you in the right direction.  In fact you might do a search here to find more info on this type of install.  Assuming you got enough RAM 1gig of swap would be fine.

 

As you can see you only have about 6GB available, if you were to re-size that swap partition you would have about 9GB available.  You will need help doing this, it is not straight forward, unless you can find the proper info on the web.

 

"How do I manage to have data saved on a separate partition?"  What type of data?  If it is just word docs and such just save it to a usb, or the Home Folder on usb.  But re-read the info above as you might have to disable UEFI or something to do this on the custom rig.  Use the command I gave you to post the specs of the pc you are doing this on now, that will be a big help.


Edited by pcpunk, 03 July 2015 - 11:51 AM.

sBCcBvM.png

Created by Mike_Walsh

 

KDE, Ruler of all Distro's

eps2.4_m4ster-s1ave.aes_pcpunk_leavemehere

 


#14 pcpunk

pcpunk

  • Members
  • 5,276 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Florida
  • Local time:01:03 PM

Posted 03 July 2015 - 11:47 AM

"Now, working on this (old) PC I am trying to figure how to create a EFI/UEFI bootable USB to be used on the new PC when needed." 

 

I think this is were you are at now, just getting this to work safely on the custom rig also.  There will be a few issues with this I think, so if you can, or wish to, I would advise getting more info from our members/advisers etc. to make this safe.  If I remember right, once you get an OS setup for one pc-then there might be issues using it on another, with different drivers needed etc.

 

You might also consider using puppy for another and keep them pc specific.  The puppy will install on a much smaller usb for which you could use that 8gb one if desired.  This will be the most desired for newer equipment if I am correct and the easiest to use.

http://puppylinux.org/main/Download%20Latest%20Release.htm

And some excellent tutorials from our Avisor Al000:

http://www.bleepingcomputer.com/forums/t/561869/how-to-create-a-secure-multi-session-puppy-cd-with-updatable-firefox-browser/

http://www.bleepingcomputer.com/forums/t/579574/how-to-install-puppy-linux-frugal-and-configure-grub2-bootloader/


sBCcBvM.png

Created by Mike_Walsh

 

KDE, Ruler of all Distro's

eps2.4_m4ster-s1ave.aes_pcpunk_leavemehere

 


#15 pcpunk

pcpunk

  • Members
  • 5,276 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Florida
  • Local time:01:03 PM

Posted 03 July 2015 - 12:12 PM

Opps, for got to post this for you.  Considering you don't have another OS on that pc do this while in Mint:  

inxi -Fx

sBCcBvM.png

Created by Mike_Walsh

 

KDE, Ruler of all Distro's

eps2.4_m4ster-s1ave.aes_pcpunk_leavemehere

 





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users