- 论坛徽章:
- 0
|
20可用积分
本帖最后由 anlan_cs 于 2014-10-29 10:54 编辑
1)dd if=/dev/zero of=c.img bs=1024 count=8192
2)losetup /dev/loop0 c.img
3)fdisk /dev/loop0
建立唯一的一个分区,并设置该分区为启动分区
fdisk 显示该img信息如下:
================================
# fdisk -l /dev/loop0
Disk /dev/loop0: 8 MB, 8388608 bytes
6 heads, 4 sectors/track, 682 cylinders, total 16384 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2a0e8fe9
Device Boot Start End Blocks Id System
/dev/loop0p1 * 2048 16383 7168 83 Linux
===============================
4)losetup -o 1048576 /dev/loop1 /dev/loop0 (第一个分区挂到loop1上)
5)mkfs.ext3 /dev/loop1
6)mkdir pp
7)mount /dev/loop1 pp
8)./grub-install --boot-directory=pp/boot --modules="serial linux gzio ext2" /dev/loop0
(疑问:这个地方之前不加--modules参数导致连serial命令都没有,加了就有了,为何?)
启动,就进入到grub>界面了,
用“ls”命令看显示(hd0),接着用“ls (hd0)/” 显示error:unknown filesystem!
增加pp/boot/grub/grub.cfg,也无济于事。 |
|