I wanted to create a bootable Linux Lubuntu install on USB flash drive, with persistent state. Apparently, I have messed up the bootloader install: now I have a USB that boots on the particular laptop where it was created, but doesn't boot on other PCs (doesn't show up in the bootable devices list). And the laptop now enters grub console right at boot, when the USB flash drive is not plugged in. It is possible to boot the OEM Windows that's on the laptop's hdd only if I select the appropriate boot device in the bios menu.
That problem with pc entering grub console at boot is a separate problem that I think I know how to fix. However, I'd like to fix that usb flash drive now.
There's a /boot directory on the Lubuntu flash drive, with grub config in
/boot/grub/grub.cfg where I can recognize the grub menu items that are displayed when the laptop boots up with flash drive plugged in. So, apparently the bootloader is installed on the laptop's hdd, and the bootloader points to the grub config that's on the flash drive.
If I do
$ file -s /dev/sdb, I get
/dev/sdb: DOS/MBR boot sector; partition 1 : ID=0x83, start-CHS (0x0,32,33), end-CHS (0x3ff,254,63), startsector 2048, 31083985 sectors; partition 2 : ID=0x5, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 31088638, 219586562 sectors
I am not sure this is expected response if the usb is not bootable.
My question is how I can now make the flash drive bootable, without disturbing its contents? And how I make it load the flash drive's grub config file when the pc is booted from it. I wonder also if the grub menu item commands should be adjusted so that the references to bootable partition work regardless of the pc the flash drive is booted on.