Let Me Count The Ways

My special interest is computers. Let's talk geek here.
User avatar
yogi
Posts: 9978
Joined: 14 Feb 2015, 21:49

Let Me Count The Ways

Post by yogi »

This thread is dedicated to my account and adventures involving the creation of a bootable USB memory stick as instructed by an unnamed person who occasionally visits the public library somewhere near Knoxville, TN. Let me say from the onset that this unnamed and unknown (to me) person is a genius. Well, at least he is well more advanced in the art of using Linux OS's than I am. I can't thank this anonymous person enough for the idea and I am indebted to Gary for being an intermediary in all of this. But, alas, I have uncovered many obstacles hidden in the instructions, most of which I have no experience with removing. This could be a very short thread, or very long. In any case it deserves to be separated from the general fiasco I am experiencing with yet another project that involves booting from removeable USB devices.

Here are the instructions I received, slightly reformatted:

anonymous wrote:What he said he does is create a bootable LIVE thumb drive first using Lubuntu since it is small.

Then he uses Gparted, the one in Lubuntu, to partition the thumb drive and shrink the partition with the .iso down, but leaves at least 30 extra megs for it to run in.

He creates a swap partition of about 4 gigs.

Then divides the rest of the thumb drive into two partitions
• one to install the desired OS and sets this partition as ROOT,
• and one for Data,

If a Linux OS like Ubuntu he uses ext4 for the two partitions. If he is installing Windows 7, he formats the partitions NTFS. Do not name the partitions yet. He added it gets complicated installing Windows. I said we only need to install a Linux OS, so he skipped whatever he was going to say about that.

From here you have two options:
• One is to install Virtual Machine, not Virtual Box or to install the Distro of choice. He does not use Virtual Machine or Box because it slows everything down.
• Download an ISO to your last partition.

Reboot into Lubuntu, and use it to select and install the OS on your last partition to the partition you want to use for the install, in this case the second to last partition.
• This will also install grub to the Lubuntu bootloader.

When the installation is finished and you boot up the thumb drive, you should get Grub showing Lubuntu or your selected OS.
If you get Windows, then you have to press esc, F1, F12, whatever to let you boot into set-up select boot from USB first, DVD second, HD third. He did say the computers here at the library are already set to boot from DVD if so equipped and USB second, if not DVD drive, then the computer checks USB first.

You will not be able to upgrade Lubuntu at all, since it is a LIVE Distro.

You should be able to upgrade everything in your chosen installed OS except the Kernel. If you want to upgrade the Kernel, you have to reinstall Lubuntu, which unfortunately wipes the entire thumb drive.

DO NOT DELETE the Lubuntu Live Install, it is what makes the thumb drive bootable from any computer.

I created create a bootable LIVE thumb drive first using Lubuntu - make that UBUNTU in my case. I know it's not part of the instructions, but it's not a fatal deviation.

Then he uses Gparted, the one in Lubuntu, to partition the thumb drive and shrink the partition with the .iso down, but leaves at least 30 extra megs for it to run in. - The instructions are not clear about how to use Gparted. Assuming Lubuntu was the running OS used to create the bootable LIVE thumb drive, Gparted could be run from there OR it could be run after booting into the thumbdrive. I chose the first method.

He creates a swap partition of about 4 gigs. - Check

Then divides the rest of the thumb drive into two partitions
• one to install the desired OS and sets this partition as ROOT,
• and one for Data,

- Gparted can't do that. Or, if it can, I have not figured out how to make it so. During installation booting from root can be a choice, but it is not part of any format or flag within Gparted. So, I simply made two ext4 partitions, one larger than the other; the larger big enough to contain the final installation.

From here you have two options:
• One is to install Virtual Machine, not Virtual Box or to install the Distro of choice. He does not use Virtual Machine or Box because it slows everything down.
• Download an ISO to your last partition.

- We will skip the VM part because I'm not doing it right now. Again, there is some ambiguity about from whence to download Lubuntu. Should it be from the running OS or should it be from within the live version. Since there was no mention about booting into the iso yet, I chose to download Lubuntu from the running OS.
- Downloading is one thing, but putting it into the "last partition" is quite another. Which partition is the last one? That depends on the order in which they were created and where they were physically placed on the thumb drive. I figured it doesn't matter, but could be wrong about that. Thus, I decided to put it into the partition on the thumb drive ostensibly dedicated to data (far right in the graphic below), and ext4 formatted.
-- To be blunt about it ... that cannot be done by mere mortals. All the partitions on the thumb drive are owned by root (or Ubuntu, believe it or not). I am not root and am therefore am denied permission to put anything in any of the partitions on that thumbdrive.
--- So, I booted up the thumb drive into the live mode hoping to assume a root identity that way. Fired up the browser and tried to download the current version of Lubunto. When Asked where to save it, I chose that "last partition" and was denied access. Try someplace else.

That's the brick wall at which I ceased to try and follow instructions. I did do something else that yielded an omen for when we progress down the list of instructions. At this point I had Ubuntu iso in a reduced size partition, a swap partition, and two ext4 partitions. I booted into the iso with the intent of installing as is usually done. When it came time to pick the location of where to place the installation, I chose the larger of the two ext4 partitions. The installer stopped dead saying it could not unmount the LIVE partition, which apparently is required to mount the target partition. It didn't explain why, it just said it couldn't do it. I have a feeling that the same message will pop up when, and if, I ever can download Lubunto to the last partition.

So I quit trying at that point. Good thing too. I'm running out of thread space for this post. :grin:

Just in case you need a visual to see what I did ...

Image
User avatar
Kellemora
Guardian Angel
Guardian Angel
Posts: 7494
Joined: 16 Feb 2015, 17:54

Re: Let Me Count The Ways

Post by Kellemora »

Sounds like he may have left something out.
However, with GParted you CAN set the Mount Point as ROOT
If you do your dev/sdb4 should show Mount Point as /
GParted is run as Root user, and I guess it took ownership of the new partitions.
You can run:
sudo chown -R $USER:$USER /media/(partition name (or probably dev/sdb4)) to fix it.
I've not hit this problem myself when setting up partitions on a USB stick using GParted.

You will have to Install the chosen Linux OS to the partition using the Live OS to prevent the bootstrap from ending up on the machines HD. It is supposed to add the new OS to the Live OSs boot partition aka Grub on the USB stick.

Since I've not tried any of this myself, I'm only passing on 3rd party info, gleaned from several different folks doing it different ways.

Whatever, I hope you finally figure it out!
User avatar
yogi
Posts: 9978
Joined: 14 Feb 2015, 21:49

Re: Let Me Count The Ways

Post by yogi »

i may look into it again some day. For now I'm way too uninformed about the ways of Linux to accomplish what seems to be a fairly easy task. Windows is easier for me to understand. I'll stick with that for a while.
User avatar
Kellemora
Guardian Angel
Guardian Angel
Posts: 7494
Joined: 16 Feb 2015, 17:54

Re: Let Me Count The Ways

Post by Kellemora »

If I ever get over to the computer store near the college where the kids are buying the pre-made sticks, I'll see if he will tell me the trick.
User avatar
yogi
Posts: 9978
Joined: 14 Feb 2015, 21:49

ISO 9660

Post by yogi »

Wikipedia" wrote:ISO 9660 is a file system for optical disc media. Being published by the International Organization for Standardization (ISO) the file system is considered an international technical standard. Since the specification is available for anybody to purchase,[1] implementations have been written for many operating systems.
Have you ever heard of ISO 9660? Neither have I until a couple days ago. Why do I care about it? Well, for one, it's intended to be a standard for opotical disc media,

BUT

That is the file format used by Ubuntu to create bootable USB memory sticks. You can use the built in disk creation tool, or the third party mkusb utility, or even the command line dd instruction. All three of those are ways to create bootable USB memory, and all three of them format the files as ISO 9660. Soooo, when I call up Gparted to resize the partition to make room for the others I want on that memory stick, IT CANNOT BE DONE. The file system on a CD is not resizable. Doesn't matter that I have a USB memory stick, Ubuntu figures if I want to make it bootable, it must be an optical disc.

My first pass attempt at this project allowed me to resize the partition because it was a FAT32 file format. I ran into other problems but I was able to resize and create new partitions. So, how did I end up with FAT32 format the first time and ISO 9660 afterwards? It's because I created the first bootable disc in WINDOWS using a program called Rufus. So, in order to get a bootable disc in FAT32 format, apparently it has to be done in WINDOWS because Linux is no longer smart enough to do it. To be fair, I'd guess Windows isn't smart enough to make ISO 9660 formatted discs.

And another point on my favorite topic. FOSS means it's free and open sourced. Guess What! ISO 9660 must be purchased. It's not free. What kind of sick irony is this?
Last edited by yogi on 20 Aug 2019, 17:55, edited 2 times in total.
User avatar
yogi
Posts: 9978
Joined: 14 Feb 2015, 21:49

Re: Let Me Count The Ways

Post by yogi »

As a side note: your suggestion to use
sudo chown -R $USER:$USER /media/(partition name (or probably dev/sdb4)) {had to use the UUID of the partition} fixed the permissions problem. The iso was moved to the last partition. But then what? How do you run an iso from inside a running Linux OS? Some say to use Unetbootin, but I tried that and it fails.
User avatar
Kellemora
Guardian Angel
Guardian Angel
Posts: 7494
Joined: 16 Feb 2015, 17:54

Re: Let Me Count The Ways

Post by Kellemora »

I'll be heading up to the library during lunch, then Planet Fitness across the parking lot to do my exercises.
Then back to the library again to see if anyone I want to talk to again is there.
I'm hoping he is there when I get there, but if not, I'm only at PF for a half hour.

I called the computer guy about the sticks he sells. The owner was not there, and the guy who answered the phone says we have a program that clones USB sticks. If I tell him what OS I want as the main OS, he can have one ready for me when I get there. But he didn't know how they were made. I said what if I want I want Mandrake. He said we only make Debian, Linux Mint, Ubuntu, and there are a couple of others up there I've not been asked about.
His boss is only there on Wednesday and Saturday to do bookwork. Maybe a tech guy knows but they are busy right now.
I said OK and hung up.
User avatar
yogi
Posts: 9978
Joined: 14 Feb 2015, 21:49

Re: Let Me Count The Ways

Post by yogi »

If you have been following my Linux adventures, and I know you have, you would have learned that I can clone any iso and make it bootable. Truth be told, it's easy and Unetbootin has been doing it for ages. There are other popular cloning programs and a few not so popular. All will make a bootable iso, with or without persistence. Apparently at least some of the kids you met in the library are happy with that. It can do almost everything a full install can do. I was going to settle on using live iso until I discovered a few things they cannot do. So, now, it's not just an academic pursuit.

I learned it is possible to install a fully working copy of Ubuntu onto a memory stick. I'm guessing any OS can go on a stick if their installer has that option. But I want to do more than just put Linux on a stick. I want to do what I am able to do with my MBR formatted discs. It's likely that it can be done in a GPT environment, but it's not as simple as it was back in the MBR days. I could be wrong about all that.


Funny that you should bring up Mandrake. I've posted about one of the OS's I was able to install on the HDD alongside Windows 10. It's called Mageia; I read recently that Magia is a fork of Mandrake which I believe they said was no longer being developed. My only comment here is that they us a KDE desktop (as does Lubuntu) which reminds me why I never liked using Windows XP. LOL
User avatar
Kellemora
Guardian Angel
Guardian Angel
Posts: 7494
Joined: 16 Feb 2015, 17:54

Re: Let Me Count The Ways

Post by Kellemora »

I do have a bit of new info for you. A tech from the computer shop called me at 9:30 am this morning. I guess he got my name and number from their caller ID and saw I was a past customer.

What he said was, you cannot repartition a pendrive after installing the LIVE OS without corrupting the pendrive.

Here is what they do. They install a LIVE USB OS on pendrive A first.
They make an iso of pendrive A on their computer hard drive.
Then they take a new pendrive B and partition it into three partitions.
Then they clone the iso on the HD to pendrive B's first partition.
Then you can install any OS to the second partition, and use the third partition for storage.
One caveat, you cannot use a CD or DVD LIVE OS installer, it MUST BE an installer to install to USB.
Once you have a partitioned pendrive with a live OS and an installed OS, you can then clone it to other pendrives.
He uses command line to do this but said it should work with a graphical installer.
All of the pendrives he sells with an installed OS work great, the same as if working from your hard drive, and does not make any changes to your computers HD, and they boot into the installed OS to avoid confusion about having a live OS on the pendrive. When you boot a desktop computer from the USB port, you will only see the installed OSs splash screen as it loads, and will not know the small Live OS is even on the pendrive unless you look at it's files.

As I said, he uses command line to do it, and said he has syslinux-utils installed and from that uses isohybrid --partok flag.
This is how you get a Live USB iso to install to a partition, if your installer is taking the whole pendrive.
But if you make your own iso from pendrive A, you should be able to clone it to a partition on the pendrive without a problem. In some cases, you may have to use partition 3 on the pendrive for the boot flag and Live OS.

Sounds simple enough to me, but then I've never tried it myself before.
User avatar
yogi
Posts: 9978
Joined: 14 Feb 2015, 21:49

Re: Let Me Count The Ways

Post by yogi »

I can't thank you enough for doing all this research. You are going above and beyond the call of duty, a fact for which I am eternally grateful. Thank you again for your assistance and encouragement.

I read through the method above a couple times and it appears to be very similar to the method used by the fellow in the library. At least the end result is the same; a live OS on USB that creates a GRUB to boot into a fully installed OS on the same USB. Being a live USB would not alter anything on the host computer. It would in fact boot prior to the HDD being recognized in BIOS. Doing it that way solves a few problems. I may try it before my next reply, but there are questions. LOL

I never attempted to make my own iso. Not sure how to do that, but Google will have the answer I'm sure. However, I can make a live USB using several different methods inside different operating systems. As I pointed out already, when I use Linux the file system seems to default to ISO 9660. When using Windows the file system seems to default to FAT32. Your instructions say to transfer a copy of this live USB to my hard drive which is formatted NTFS. The iso image probably can live in all three of those worlds as a flat file, but maybe not.

Speaking of USB pendrives ... they can be formatted MBR or GPT. The latter would be for UEFI booting. Will this technique work for both MBR and GPT? Since this pendrive ultimately will be independent of the host computer does it matter what format it is? Which brings up a similar question about partitions. The finished product will have three partitions. What file format is preferred? I know about the data partition; it can be NTFS, FAT32, or ext4 depending on how that data will be used. The live OS partition will take care of itself, hopefully. And how about formatting that full-install partition? What should THAT be? AND, I suppose I should use my own judgment about the size of the USB stick. It may all fit on 32GB but 64GB probably would be better.

My understanding is that all memory media has it's own hidden code to make it operable. That hidden code is not the same for CD and USB. That's why it is important to know what kind of installer you are using. Well, I have a USB installer on all my Linux boxes. It's called mkusb; what else? This is one of the installers that uses the ISO 9660 CD/DVD file format system in place of FAT32. I know it sounds crazy, but I have seen with my very own eyes the end result. mkusb writes a CD format to USB pendrives. I must say that I've only seen that happen with Lubuntu (a product of my last experiment), but I don't see why the OS would matter in determining which file format to use. Maybe the recommended command line utility syslinux-utils takes care of all that automatically. Then, maybe not. I have yet to find out.

Cloning iso images sounds simple and the phrase is used all the time. But, cloning is not the same as copy-and-paste. The only method of making a cloned copy of an iso involves using the Linux dd command. I see potential problems there if I have to clone a file with an ISO 9660 format to an NTFS formatted hard drive and then back again to the pendrive. That will never work. LOL

All these things I am asking myself will be explored in the not too distant future. I am negatively impressed with the difficulties involved with a concept that is simple. I guess the old truism is ringing in my ears, "if you think the solution to the problem is simple, you don't understand the problem." I don't understand Linux, and that's the truth.
User avatar
Kellemora
Guardian Angel
Guardian Angel
Posts: 7494
Joined: 16 Feb 2015, 17:54

Re: Let Me Count The Ways

Post by Kellemora »

When he started talking about command line stuff I stopped him right there as it is way over my head, and getting it written down correctly is another problem since everything about command line is sensitive to a space and the case.

I did not know until we started talking that an ISO for a CD/DVD is different than for a USB stick. That could very well be why I was not able to get some OSs installed using a USB stick, but could if I burned to a DVD.

The way each person I've spoken with worded things, they all sounded logical in how they did it.
But obviously, I'm not getting the whole story either. One problem could be how each person does it works on the machine they are making their USB stick from, but may not work on another machine to make the USB stick.

The install program for a LIVE USB OS creates its own format.
But for the Installed Program, the partition should be formatted to what that OS prefers, ext4 for Linux or NTFS for Windows.
I'm also thinking the tech guy from the computer store hit something important when he said to put the boot sector on partition 3. Seems I've seen that a couple of times now. Live install on partition 1, but when you do a full-install of another OS it belongs on partition 3 and marked as Root and set as Boot too, unless that means the same thing. Even getting over my own head here again, since I've never done it.
Remember, I still used 5-1/4 floppies until computers no longer recognized 5-1/4 drives anymore, hi hi.
Good think I copied a few of my 5-1/4 floppies over to CD, namely the data ones I had as permanent backups.
And now I come to find CDs die by rotting themselves to death.

I wonder if USB sticks will hold data for permanent storage for very long.
My old IDE drives may die someday too, hi hi.
User avatar
yogi
Posts: 9978
Joined: 14 Feb 2015, 21:49

Re: Let Me Count The Ways

Post by yogi »

Well, my friend, I do realize that something gets lost in every translation. This is true even if you are an expert on the topic being translated. When I read any instructions you pass along, I take that translation issue into consideration. Then, there is also the problem of saying what you mean, and not meaning what you say. Your last response here included a tiny bit of data that was written differently in previous replies. Allow me to explain ... :mrgreen:

Last night I tried to follow your most recent instructions, and ran into a dip in the road. A roadblock in fact. But, this time the ultimate goal is in sight. My first concern was in learning how to create an iso image. Google has the answer; actually Google has many answers. About 95% of those answer explain how to do it inside a Windows environment and the Windows OS being the target. There are a couple programs that can be run under Windows and I actually downloaded one to see what I could do. It was trash and I uninstalled it almost immediately. Besides, I wanted to know about a Linux iso created in a Linux environment.

The answer was in one of the Ubuntu forums, and I could not believe how simple it was:
  • dd if=/dev/sdb1 of=Lubuntu.iso
That is to say,
  • use the Linux dd command line utility
    the if (input file?) is everything on the /dev/sdb partition 1, or sdb1
    the of (output file?) is to be a single ios file called Lubuntu.iso
The dd command in Linux takes care of everything else. It does a recursive copy of the device (partition 1 in my case) and pastes it into an iso formatted file in the directory I happen to be sitting in. So, now I had an iso image of partition 1.

I then partitioned a second USB pendrive into three parts. I did them all in FAT32 with the understanding things could change along the way.
I then "cloned" the iso I just made and placed it in the first partition of the second USB stick. Not knowing for sure what "clone" means, I simply used the above Linux dd command in reverse. So. now I had a three partition USB stick with a cloned OS in the first partition

Next step is to install any OS into the second partition, which I did. Ubuntu 19.1 installed there just fine.

HOWEVER (and there always is a however)

Ubuntu, being what it is, gave me its standard option to select where I want to install GRUB. I re-read the instructions and could not determine where to put it. So, I selected the first partition where the live OS is installed with the hope that it would overwrite the GRUB put there by the live OS. It did not.

So I reinstalled Ubuntu, and this time selected the same partition on which the installed OS is located. And, I set the boot flag as well. Didn't matter. The live OS version of GRUB came up when I turned on the power. There was no option to select the installed OS.

At that point I stopped because some real life events needed attention. And that's where the project stands as I type this. The instructions you were kind enough to reproduce did not specify where to install GRUB. I'm nearly certain it doesn't matter because I've never been able to get the Ubuntu installer to put GRUB where I want it. Why should it do it now? Anyway, last night's reply stated that the Computer Store guy said to put the boot sector on partition 3. That's not exactly how you worded it in the initial instructions. That IS how an efi boot works. GRUB and any other boot instructions go into a small FAT32 partition of their own.

No mention of UEFI booting was ever made, which makes me wonder about exactly what should go into that third partition. At least I have a hint now. I will indeed try to make a partition solely for the purpose of booting. My hope is that I can force the USB to boot from the installed OS instead of the live OS. If I can force it, then I'll be asking myself why bother with setting up a live version? LOL

Anyway, those honey-do projects still need to be completed. It may take a day or two to give you an update.
User avatar
yogi
Posts: 9978
Joined: 14 Feb 2015, 21:49

Additions, Changes, Clarifications

Post by yogi »

Image

I'd like to ask that you review my above summary of your investigations and to let me know if there is anything you can add to it, change, or clarify. All the information is from posts you made in this thread so that details could be found herein if you need to see the context. I want to be emphatically clear that I realize I'm asking a lot from you. I would be perfectly happy if you simply agree with what I summarized and went no further. Remembering technical instructions about things you barely understand is not easy. So, please don't feel obligated in any way.


STATUS

My previous post made it clear that I'm no further along tonight than I was about two weeks ago. I do have a LOT more information to go by, thanks to you, Gary. There are some common things both methods use:

1- A live OS should be installed on the first partition of the final working USB memory stick. This is the workhorse that actually boots the system on any computer because it's an ISO image. That's what ISO's do; boot anywhere.

2- An ISO of the desired OS should be downloaded (copied to) the last partition.

3- Use that downloaded ISO to install a full version into the third (middle) partition.

4- Some partition, it's not clear to me which, should be /ROOT and flagged boot.

All the details needed to accomplish those four steps are not clearly understood by me. For instance, the assignment of a partition to /ROOT. Or, booting from the OS in partition 1 to run the ISO in partition 3 doesn't seem possible. And there are other questions too.

There is also on nagging detail that I have no idea how to fix. Every time I install an OS using the laptop, the Windows bootloader is affected. The OS installation process writes to the Windows bootloader announcing its presence. From there things get weird in that the previously installed Ubuntu OS on the laptop HDD no longer can boot. So, even if all the riddles associated with the above four steps are solved, everybody says the Windows bootloader should not be affected. Well yeah. But it is.

I may be able to work this out on my own. I certainly have a lot of articles in my reference library now and somebody must allude to a solution for me. I mean, you talked to people who are doing it. So it is possible. All I need to do is find out what I'm missing.

I might just try to do this from my MBR formatted tower. None of the instructions you provided mention the disc format. UEFI is not spoken. Does that mean it's all done in DOS? I probably will try it some day, but I fear the same thing might happen in the tower that's happening in the laptop. I don't want to mess up any perfectly good bootloaders for Windows 7. It's so reliable and works every time.
User avatar
Kellemora
Guardian Angel
Guardian Angel
Posts: 7494
Joined: 16 Feb 2015, 17:54

Re: Let Me Count The Ways

Post by Kellemora »

I know these kids mentioned several programs they used like unetbootin, rufus, and others, but most I talked to were basically Windows users but needed Linux for downloading stuff fast.

I was looking through the handwritten notes I made, and ran across this program I've never mentioned.
If you have Ubuntu installed on one of your computers. In their repositories they have a .deb program named MultiBootUSB.
This program is supposed to be straightforward for creating a bootable USB stick on EFI computers.
You might be able to learn how it works and what it does by doing an on-line search about using MultiBootUSB.

I won't get a chance to go to the library today as I had hoped. Frau works later than usual, and will be bringing lunch home with her for us.
User avatar
yogi
Posts: 9978
Joined: 14 Feb 2015, 21:49

Re: Let Me Count The Ways

Post by yogi »

I have a multi-boot USB creation tool for Windows, but I'll be looking into the one for Ubuntu as well. The Windows version is called Yumi and it does what it says in surprising ways. To test Yumi I installed Ubuntu first and it worked just fine as Ubuntu generally does. Then I installed Mageia which is the fork from Mandrake I was talking about elsewhere. That worked fine too. Then, to test the limits of a 32GB memory stick, I installed Kali. Kali has a bunch of penetration testing tools but is essentially a version of Debian that looks kind of like Mint. LOL Does that make sense? Anyway, Kali did not appear on the available OS list as you would see on a normal GRUB menu. Apparently it installed, but I could not find it where I expected it. There was a menu selection for system tools, and that is where they put Kali. Thus I would have to go through extra menu selections to boot up what I consider a regular OS and not a toolbox. In the end Kali and Magia had boot problems associated with nVidia, and I didn't feel like fixing them on this test drive. Yumi does create a multiple boot USB stick, but they need to do something to improve the menu.

If MultiBootUSB does what Yumi does, then I won't learn much. I'm already capable of making live iso discs with persistence. If they do it as UEFI, then I might be able to see something new. But, as we know, UEFI isn't a Linux specialty. Besides, from what I can tell, anything UEFI will modify my existing Windows bootloader.
User avatar
Kellemora
Guardian Angel
Guardian Angel
Posts: 7494
Joined: 16 Feb 2015, 17:54

Re: Let Me Count The Ways

Post by Kellemora »

See, that's what I don't understand. I don't know why running from a USB stick would have anything to do with the machines bootloader. Unless that is happening when you are writing the USB stick with an OS.
Perhaps that is why one of the kids said to run a Live OS from the USB stick and make a new USB stick using the tools in the Live OS. Maybe that keeps it from messing with the computers internal bootloader.

We are going to a Germanfest at a Lutheran church in about an hour. I doubt we will stay for very long. It will not be like an Octoberfest, hi hi. It is more than likely just the Theme the church is using for a bazaar, hi hi. Although they do have bands and entertainment. We'll see!
User avatar
yogi
Posts: 9978
Joined: 14 Feb 2015, 21:49

Re: Let Me Count The Ways

Post by yogi »

Perhaps that is why one of the kids said to run a Live OS from the USB stick and make a new USB stick using the tools in the Live OS. Maybe that keeps it from messing with the computers internal bootloader.
Nope. That's exactly how my Windows bootloader gets modified - every time.



After sleeping on it for a while I decided to give it all one more shot.

On the ASUS tower now, I created a live USB. Tested it out on both the tower and laptop. It boots fine on both machines; a totally expected outcome.

I then created two partitions next to that live OS (which happened to be Lubuntu, by the way)

Next I created another live USB; this time with Ubuntu 19.04. This would be my target installer. I used the Ubuntu live USB to install itself on one of those two partitions of the other live (Lubuntu) USB stick. The installer objected to the fact that there was no efi partition. Reluctantly I created one and flagged it boot, and esp. After that the installer completed successfully and placed Ubuntu on the live USB alongside of Lubuntu.

This is the configuration everybody says works. So I tried booting into this Lubuntu/Ubuntu frankenstein of a USB and ... it booted up into Lubuntu. There was no option in GRUB that showed the other OS installed on that memory stick. Just for grins, I moved over to the laptop for the ultimate test. It did the same thing as the tower. It booted into Lubuntu as if Ubuntu never existed.

Live ISO discs can't be modified. That's against the rules. Thus, it's not surprising that this memory stick, now with two OS's on it, would only boot into the live version. As it happened, Ubuntu also installed a copy of GRUB into that efi partition it complained about. Flagging it boot and esp doesn't overcome the GRUB in the live ISO partition.

So, just for grins, I deleted the live Lubuntu ISO partition. The efi partiltion for Ubuntu remained in tact. Doing this causes a kernel panic type error and goes into a restart loop. The reason for that is the GRUB written to the Ubuntu efi partition has a disc UUID in it's configuration file. That UUID is not valid and causes the fatal error during boot.

Can you say, back to square one?

But now I think I know the solution. The GRUB associated with the live OS has to be modified to chainload the other GRUB created by the installed OS. That's something I think I can learn to do. Preventing the OS installer from modifying the Windows 10 bootloader is a whole 'nother story.
User avatar
Kellemora
Guardian Angel
Guardian Angel
Posts: 7494
Joined: 16 Feb 2015, 17:54

Re: Let Me Count The Ways

Post by Kellemora »

I hate to say this, but I know those kids are not smart enough to get into the inner workings of a USB stick, namely into the bootloader.

There has got to be something really simple we are overlooking, and I'm not picking up in their conversations either.

I'm sure you have seen this in your website searches, but from what I understand this one does work.
I've read it a couple of times to see what I may have missed, but can't find anything I've not already got from other people.
Well, except for the guy about using partition 3, but I've not found anything like that on-line.

If I had the time I would test this myself, but gosh darn, it sure seems straight forward to me.

https://www.tecmint.com/install-linux-os-on-usb-drive/
User avatar
yogi
Posts: 9978
Joined: 14 Feb 2015, 21:49

Re: Let Me Count The Ways

Post by yogi »

I was thinking along the same lines as you. I know kids these days are pretty smart, but they don't want to be bothered with anything that needs actual learning experience. So, yes, I agree that they must be doing something fairly simple. But, then, are they doing what I am aiming to do? I'll assume they are, but it's possible their approach to the portable OS problem isn't exactly the same as what I want. There are a lot of variations on this theme and what I want to accomplish isn't written about very often.

Having said the above, I will say that I have read a few articles similar to the link you offered.
Amit Hambar wrote:Requirements:

One Pendrive 4GB or More (Let’s call it as Main USB drive/Pendrive).
One more Pen drive or DVD disk to use as bootable Linux installation media.
Linux OS ISO file, for example Lubuntu 18.04.
One PC (Don’t worry, there will not be any effect on that PC).

TIP: Use 32 bit Linux OS to make it compatible with any available PC.
I added the emphasis to where I anticipate running into problems. Although I have corrupted my Windows bootloader several times, I'm going to try this technique one more time. I realized from day #1 that assigning the correct placement for the GRUB bootloader is critical. I can't tell you how many times I've had to rebuild my Windows 7 MBR because I failed to make the correct selection installing Linux on the ASUS tower. It's easy to just accept the default Linux provides, which is /dev/sda.

The doubt I'm having is about the partition I actually select. My pendrive will typically have two partitions and sometimes up to four depending on who's brilliant idea I'm trying to replicate. Hence, after reading the article you linked to, and another I found this morning, the point I have been overlooking is to select the entire USB stick, not any of it's partitions. I've been tinkering with EFI boot which demands an EFI partition, but your article and others I've seen lately never mention a EFI scenario. Sounds good, but the Ubuntu installer wants one or it won't install.

My dilemma isn't new, apparently. UEFI is a problem for other people too. The bootloader corruption problem has fixes and work arounds that to me are very complex. I hesitate to mess around with the booting up of Windows 10 just to accommodate Linux. There is something intuitively wrong with that approach. Fortunately, I've found a somewhat unorthodox yet elegant solution in an Ubuntu forum:
https://askubuntu.com/questions/16988/h ... tor#324899
There are a few answers there and the one at the end puts it into understandable language. The process is the same as what the article you linked to suggests with one caveat. Remove the hard drive from the laptop before doing the installation. Makes sense, eh? If the WIndows bootloader is the problem, just remove it. What could go wrong? :mrgreen:
User avatar
yogi
Posts: 9978
Joined: 14 Feb 2015, 21:49

Re: Let Me Count The Ways

Post by yogi »

SHORT UPDATE
  • ERASED memory stick
    CREATE 2 partitions; ext4, FAT32
    INSTALL Ubuntu 19.04 to USB memory stick
    (this time instructed the installer to put GRUB on the entire device /dev/sdb)
    REBOOT laptop into Windows boot menu
    the option to boot into USB Partition2 was present and selected
    BOOT FAILED
    Fallback to Windows 10, and, as expected, the Windows 10 bootloader for Ubuntu was now corrupt.
Placed the USB into the ASUS (MBR format) tower.
FAILED to recognize anything bootable on USB device.

Since the laptop is EFI, I decided to vary from the instructions and create an EFI partition with esp and boot flags set
Reinstalled Ubuntu: same failure.

These failures are probably due to the same conflicts found in Linux Mint wherein that distribution erroneously identifies itself as Ubuntu instead of Mint. The Windows boot loader cannot determine which Ubuntu is actually Ubuntu. The same type of conflict must exist with the USB memory.

Two reasonable options for an attempted USB install remain
1- Delete Ubuntu from the laptop hard drive, or
2- Physically remove the hard drive (might be possible to disable it in BIOS, but I'm not optimistic)
Post Reply