祝大家晚上好!我一直在研究這個問題,但無法弄清楚。我只是試圖獲得在一個附加的媒體上安裝的引導程序的工作引導代碼,但無法弄清楚這一點!我已經嘗試了grub legacy,lilo和grub2 ...主機系統將其驅動器列爲/ dev/sda *,目標附加介質列爲/ dev/sdb *並掛載到/ mnt/target。使附加媒體可啓動
使用GRUB的遺產,我試圖與已經有安裝它,並試圖像髒黑客其他介質上(的/ dev/SDC *,到/ mnt /源)一起工作:
dd if=/mnt/source/boot/grub/stage1 of=/dev/sdb bs=446 count=1
dd if=/mnt/source/boot/grub/stage2 of=/dev/sdb bs=512 seek=1
這實際上啓動進入GRUB界面,您可以輸入之類的東西:
root (hd0,0)
setup (hd0)
我沒有得到任何錯誤消息,但GRUB將引導至垃圾在屏幕上,然後停止。
使用LILO,我其實是有安裝的軟件包,並試圖建立(創建lilo.conf中後):
default=Test1
timeout=10
compact
prompt
lba32
backup=/mnt/target/boot/lilo/MBR.hda.990428
map=/mnt/target/boot/lilo/map
install=/mnt/target/boot/lilo/boot.b
image=/mnt/target/boot/vmlinuz
label=Test1
append="quiet ... settime"
initrd=/mnt/target/boot/ramdisks/working.gz
然後從提示符下執行以下操作:
$ lilo -C /mnt/target/boot/lilo/lilo.conf -b /dev/sdb
Warning: /dev/sdb is not on the first disk
Fatal: Sorry, don't know how to handle device 0x0701
隨着grub2,我嘗試了這樣的:
grub-mkconfig -o /mnt/target/boot/grub/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.11.0-12-generic
Found initrd image: /boot/initrd.img-3.11.0-12-generic
Found memtest86+ image: /boot/memtest86+.bin
No volume groups found
done
我甚至無法得到上述正確生成grub.cfg或在正確的位置,所以我放棄了這一個......上面列出的條目是針對主機系統的,而不是目標系統。
我可以提供任何其他信息,你們需要幫助解決這個問題。
-UPDATE-
與媒體的時間長一點的工作之後,我決定開展一項「的fdisk - 」,並顯示以下信息:
Partition 1 has different physical/logical beginnings (non-Linux?):
phys(0,32,33) logical(0,37,14)
Partition 1 has different physical/logical endings:
phys(62,53,55) logical(336,27,19)
我也請注意,當我嘗試安裝分區時,我總是會收到一條消息,指出:
EXT4-fs (sdb1): couldn't mount as ext3 due to feature incompatibilities
不確定這是否只是特定於忙框,或者如果這與fdisk輸出有關。無論如何,我不知道fdisk信息是否表明磁盤幾何可能會導致所有這些引導程序無法正常工作。
感謝您的回覆,但看起來您的dd命令與已經使用的命令相匹配。它不會覆蓋分區表,因爲它會跳過前512個字節(通過seek = 1開關)。任何其他想法? – user1646428
「我的」dd命令是你的副本。你是對的,尋求從0開始計數不是1. – snayob
早上好,snayob和謝謝你的回覆。 Seek不是從0開始,而是從1開始。如果我找到0,那麼數學就是0 *任何= 0實際上不會跳過任何東西。任何其他想法? – user1646428