Confirm mbr.bin is working correctly for what it is needed for?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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:
[root@foo kickstart]# isoinfo -i foo.iso -d
CD-ROM is in ISO 9660 format
System id: LINUX
Volume id: foo
Volume set id:
Publisher id:
Data preparer id:
Application id: GENISOIMAGE ISO 9660/HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE (C) 1997-2006 J.PEARSON/J.SCHILLING (C) 2006-2007 CDRKIT TEAM
Copyright File id:
Abstract File id:
Bibliographic File id:
Volume set size is: 1
Volume set sequence number is: 1
Logical block size is: 2048
Volume size is: 4323253
El Torito VD version 1 found, boot catalog is in sector 980
CD-ROM uses ISO 9660:1999 relaxed format
Joliet with UCS level 3 found
Rock Ridge signatures version 1 found
Eltorito validation header:
Hid 1
Arch 0 (x86)
ID ''
Key 55 AA
Eltorito defaultboot header:
Bootid 88 (bootable)
Boot media 0 (No Emulation Boot)
Load segment 0
Sys type 0
Nsect 4
I just tried to boot off of this SSD and getting "Reboot and Select proper Boot device or Insert Boot Media in selected Boot device and press a key."
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.
take a custom Linux ISO (RHEL), place it on a SSD and boot from it.
An ISO9660 filesystem is only bootable from a hard/flash drive if it is a hybrid ISO or you are using a bootloader like grub or one of the specialty ISO file bootloaders. What exactly is foo.iso i.e installer or live version etc. It is not an image file from a hard drive partition.
You can mount the file via a loop device and inspect its contents.
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.
-------
I just tried to boot off of this SSD and getting "Reboot and Select proper Boot device or Insert Boot Media in selected Boot device and press a key."
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.
Your method does not create a bootable drive.
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.
only bootable from a hard/flash drive if it is a hybrid ISO or you are using a bootloader like grub or one of the specialty ISO file bootloaders. from a hard drive partition.
I'm not sure how to create a hybrid ISO? Use the isohybrid command?
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
Last edited by JockVSJock; 12-02-2020 at 07:22 PM.
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:
/dev/sdb1 <------ set bootable via fdisk
/dev/sdb2 <---------- iso gets copied here from dd command
When you use dd to put iso on a dev you need to use whole device not a partition.
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.
Last edited by colorpurple21859; 12-02-2020 at 09:44 PM.
When you use dd to put iso on a dev you need to use whole device not a partition.
dd to /dev/sdb not /dev/sdb2. However this will make the drive read-only.
I've tried this route too and when the ISO boots, I don't get a splash screen and the process locks up here:
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?
Last edited by JockVSJock; 12-03-2020 at 07:31 AM.
[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'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?
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 kept locking my Linux Questions account at work, so I have to post this from home.
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
The isoinfo command didn't show a good status under Boot Media and the file command didn't show mbr/dos status.
EDIT: This is the command that I ran, where I removed the el-torito command
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.