Confirm mbr.bin is working correctly for what it is needed for?
I tried using the search on Linux Questions for this and didn't find anything along with googling Linux Questions and my search terms and couldn't find anything.
How do I confirm that mbr.bin is good, working and able to do its job? I can't even find mbr.bin under /dev/sda1 which points to /boot? So does this file really live under /dev/sda? I'm prepping a removable SSD that is 512 GB in size and have created a boot partition under /dev/sdb1 with the size of 512 MB. I want to place mbr.bin under this directory in order to boot correctly. I've used the following command to generate mbr.bin Code:
dd if=/dev/sda of=/tmp/mbrsda.bak bs=512 count=1 Code:
[root@foo tmp]# xxd mbrsda.bak Also I've run file against the mbr.bin file and its returning more partitions which I didn't expect. Code:
|
I think mbr.bin is simply the Windows name for the master boot record of a traditional dos disk. This contains the bootloader (or its first stage in the case of GRUB) and the partition table. You will not find it listed under any of the partitions. It belongs to the disk as a whole (/dev/sda), but there is no filesystem for that. The mbr is a "magic space" that lies outside Linux altogether. You can of course copy its contents into a file using the dd command and call the copy mbr.bin or anything you like, and some people like to keep a backup copy of that sort just for safety.
A quick way to list your partition table is to use (as root) the command fdisk -l /dev/sda. The best way to find out if the mbr is OK is to boot the computer! If it boots, you have nothing to worry about. |
That file, as hazel said, is likely a copy of the MBR.
If the PC boots the MBR is good and a copy is not needed. If using UEFI to boot then it could be a significant problem to do anything with it. Your output of mbrsda.bak shows the partition table with each partition defined. That definitely is an MBR boot sector. Altering the boot sector unnecessarily can break the drive access and booting. |
This is what I'm trying to do high level: take a custom Linux ISO (RHEL), place it on a SSD and boot from it. Once it boots successfully, move that same SSD to another computer to prove it successfully boots.
I've not really worked with stuff like this in the past. To me, there are a lot of moving pieces to get this working correctly. I have two partitions /dev/sdb1 <------ set bootable via fdisk /dev/sdb2 <---------- iso gets copied here from dd command I've copied over the mbr.bin to /dev/sdb1 from the RHEL7 workstation that I'm working from. When I run file command against the iso, I don't show a mbr/dos boot sector, but I do show (bootable) at the end. The isoinfo command shows bootable too, but still not booting correctly. Code:
I know the ISO is good, because in KVM, I can create a VM, and boot off of this ISO so I know its good. |
Quote:
You can mount the file via a loop device and inspect its contents. |
Quote:
You can do an install on one drive then move that drive to another PC and in most cases it will boot. Simply because the iso is copied onto the HDD or SSD does not make the HDD or SSD bootable. Most of the files on that iso image are in rpm or other compressed format. Assuming that the iso is a live image or installer; Writing that iso image onto a USB using dd, or fedora media writer (or another tool that can put the iso image onto the device at low level) then booting from the USB and doing an install to the SSD should give you what you want. |
Quote:
I've tried a few isohybrid commands against this ISO, but still not successful. I'm pretty sure we are using mkisofs to make this iso, which from what I read online, is not correct to make a bootable ISO from USB/SSD. I've also tried going the GRUB route too and wasn't successful here either. If you have any pointers or advise, then let me know. thanks |
|
Quote:
Quote:
dd to /dev/sdb not /dev/sdb2. However this will make the drive read-only. The other way is to create partitions and filesystems, mount the iso copy the contents over and install bootloader to the mbr. On uefi systems will need an esp partition. |
Quote:
Code:
[ 15.034666] loop: module loaded I'm using mkisofs to create the iso. Is this command no suited for bootable SSD media and only for bootable CDROMs/DVDs? If this is the case, what command should I be using to prepare this iso to use SSD instead? Since I'm using a smaller SSD now, I'm not treating the iso with isohybrid either? |
I think you will need to use isohybrid on the iso
https://www.mankier.com/1/isohybrid https://wiki.syslinux.org/wiki/index...itle=Isohybrid |
[quote]I'm using mkisofs to create the iso. Is this command no suited for bootable SSD media and only for bootable CDROMs/DVDs? If this is the case, what command should I be using to prepare this iso to use SSD instead?[quote]
Your ISO file is bootable as a DVD/CD because it includes the El Torito boot code (Eltorito defaultboot header:) but it is not suitable for booting SSD media nor can you use dd to copy the ISO to a partition. Just not enough information about your custom ISO to know how to write it to disk. I would try mounting the ISO and checking its contents to see if it looks like a regular OS. Create the appropriate partitions and filesystems on the empty drive and just copy the files over. Boot the ISO from a physical optical disk if possible, chroot to the hard drive and install grub. If your customized system does not have all of the grub tools you might be able to get away with using another live DVD. |
I've used the
Code:
--partok Since I'm using a smaller capacity SSD, won't need the Code:
--uefi So looking at the --help options, I'm at a loss of what isohybrid commands to use against the .iso. thanks |
Quote:
Code:
dd if=<path to iso> of=/dev/sdb bs=4M |
Quote:
I used the genisofs command to generate the iso and dropped the El Torito flag, used the dd command to copy the .iso file over to /dev/sdb and this is the error message that I got when I tried to boot from it. Code:
Reboot and select proper boot device or insert boot media in selected boot device and press a key EDIT: This is the command that I ran, where I removed the el-torito command Code:
genisoimage -l -r -J -V "vol_name_goes_here" -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -c isolinux/boot.cat -o /tmp/name_of_iso_here.iso -no-emul-boot . |
All times are GMT -5. The time now is 09:00 PM. |