How to make thumbdrive bootable
I've copied an upgraded system (ubuntu 16.04) to a thumbdrive and want to make it bootable. I mount the thumbdrive (/dev/sdc1) and chroot to it. I make necessary changes to /etc/fstab to mount the thumbdrive as /. I then run mkinitramfs to create a new initrd.img-{version}. The problem is trying to install grub in /dev/sdc. When I try, I get "grub-install: error: cannot find a device for /boot/grub (is /dev mounted?)." In a normal installation, the fstype of /dev is udev, but I don't know how to make that happen in these circumstances. Any help will be appreciated.
|
Most modern usb flash drives can be made bootable. Might take some steps. Can you see if syslinux will install?
Otherwise I'd remove internal hard drive and install Ubuntu from DVD to this usb and see if that works. A normal install. If it then boots correctly then maybe copy over your install. Guess you could try reducing the original partition and use a clone program/distro. Might try using grub command to install to the usb may assume you have the /sdb1 mounted maybe. |
Have you looked at unetbootin?
|
did you run the following before chroot?
Code:
mount --bind /dev /<sdc1 mountpoint>/dev |
Quote:
The good news: The mounts did what I wanted. The bad news: grub-install didn't work - gave me the following errors: Code:
grub-install: warning: your embedding area is unusually small. core.img won't fit in it.. |
Is this an efi system, is the usb gpt or msdos layout, are you installing to sdc or sdc1?
|
To answer my own question, judging by the reviews on a usb 3.0 flash drive at Best Buy, it is bootable.
|
Quote:
|
Quote:
Quote:
Quote:
|
Quote:
|
I couldn't apt-get lilo after chroot to /mnt so I installed it in the un-upgraded system and ran liloconfig. Following is the /etc/lilo.conf file with (most) changes I think I need. Not sure about the line "map = /boot/map". I'm guessing it might be "/mnt/boot/System.map-4.4.0-93-generic".
Code:
# /etc/lilo.conf - systemwide LILO configuration (LILO 23) |
Shrike is over 14 years old! If the original installation was done with it, and the original partition "CHS" configuration remains, it explains lack of room for core.img, a combination of inadequate space in the legacy "boot track", and sdc1 starting immediately following the "boot track" instead of leaving 1MB of freespace to permit bootloader code to overflow the "boot track". If you start installation from scratch (wiping the stick first) with any modern distro, its partitioner will leave unpartitioned space following the "boot track" for core.img to use. Using GPT instead of MBR partitioning after wiping is an alternative.
To keep the old installation in place and functional, instead of sdc, you could try installing Grub to sdc1, and setting sdc1 active/bootable. Ignore Grub's complaint about unreliability of blocklists, as I do, in multibooting many PCs. All mine have Grub installed, but none have it installed to an MBR. Boot here is always initialized from a primary partition (no GPT disks here). |
Quote:
Thanks! |
All times are GMT -5. The time now is 01:06 PM. |