QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1654|回复: 7

linux下挂载镜像文件

[复制链接]
发表于 2005-7-6 09:34:41 | 显示全部楼层 |阅读模式
我的FC4是从硬盘安装的,在添加删除软件包的时候系统提示要插入光盘,请问怎样将一个镜像文件挂载成为光驱,或者linux下有没有虚拟光驱软件?
发表于 2005-7-6 09:36:59 | 显示全部楼层
请问原来如何通过硬盘安装的?那个过程中不需要mount -o loop你的镜像吗?
回复

使用道具 举报

 楼主| 发表于 2005-7-6 09:40:43 | 显示全部楼层
[quote:6cd8178b61="darkyeah"]请问原来如何通过硬盘安装的?那个过程中不需要mount -o loop你的镜像吗?[/quote]
我是参考下面的一篇文章安装的
[code:1]制作USB启动盘 硬盘安装fc4



--------------------------------------------------------------------------------





1、准备一个U盘,备份里面的数据 (很废话)

2、准备第一张光盘里的 /images/diskboot.img 文件 (我是放到 /root/ 下 (也废话)

3、有一个可以运行的linux系统

4、把U盘插入计算机如果是自动挂载则要卸载。

5、

代码:

# fdisk -l





输出为



代码:

Disk /dev/sda: 80.0 GB, 80026361856 bytes

255 heads, 63 sectors/track, 9729 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes



   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1        1321    10610901    7  HPFS/NTFS

/dev/sda2            1322        9729    67537260    f  W95 Ext'd (LBA)

/dev/sda5            1322        2040     5775336    7  HPFS/NTFS

/dev/sda6            2041        3570    12289693+   7  HPFS/NTFS

/dev/sda7            3571        7499    31559661    b  W95 FAT32

/dev/sda8            7500        8166     5357646    b  W95 FAT32

/dev/sda9            8167        8179      104391   83  Linux

/dev/sda10           8180        9729    12450343+  8e  Linux LVM



Disk /dev/sdb: 125 MB, 125682176 bytes

4 heads, 60 sectors/track, 1022 cylinders

Units = cylinders of 240 * 512 = 122880 bytes



   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1   ?    14341948      624086   501340218+  5d  Unknown

Partition 1 has different physical/logical beginnings (non-Linux?):

     phys=(195, 91, 1) logical=(14341947, 2, 58)

Partition 1 has different physical/logical endings:

     phys=(358, 102, 24) logical=(624085, 3, 18)

Partition 1 does not end on cylinder boundary.

/dev/sdb2   ?     7777694    14916873   856701495+   4  FAT16 <32M

Partition 2 has different physical/logical beginnings (non-Linux?):

     phys=(374, 252, 61) logical=(7777693, 1, 18)

Partition 2 has different physical/logical endings:

     phys=(252, 139, 46) logical=(14916872, 1, 48)

Partition 2 does not end on cylinder boundary.

/dev/sdb3   ?        4370        4370           0   64  Novell Netware 286

Partition 3 has different physical/logical beginnings (non-Linux?):

     phys=(357, 105, 44) logical=(4369, 0, 17)

Partition 3 has different physical/logical endings:

     phys=(0, 13, 10) logical=(4369, 0, 16)

Partition 3 does not end on cylinder boundary.

/dev/sdb4           12289       46968     4161536    0  Empty

Partition 4 has different physical/logical beginnings (non-Linux?):

     phys=(0, 0, 0) logical=(12288, 0, 1)

Partition 4 has different physical/logical endings:

     phys=(0, 0, 0) logical=(46967, 1, 52)

Partition 4 does not end on cylinder boundary.



Partition table entries are not in disk order







我的硬盘是sata的,所以u盘识别为sdb 见红色部分

大小为 125682176 bytes



6、把镜像写到u盘



代码:

# dd if=/root/diskboot.img of=/dev/sdb bs=125682176







7、重启计算机用u盘启动

8、安装。。。。。。。。。。。。。。。。。。。。[/code:1]
回复

使用道具 举报

发表于 2005-7-6 09:52:02 | 显示全部楼层
不知你4cd的镜像放在哪里?你重启u盘后怎么选4cd镜像安装的?
回复

使用道具 举报

 楼主| 发表于 2005-7-6 10:16:38 | 显示全部楼层
我下载的是1DVD的镜像,装的时候是放在一个FAT32分区里的,U盘启动的时候选择从硬盘安装并输入镜像的路径就可以了.
回复

使用道具 举报

发表于 2005-7-6 10:28:36 | 显示全部楼层
原来如此。。。你现在可以用mount -t vfat /dev/hda5 /mnt/tmp的方式将该fat32分区(假设你镜像在hda5中)装到系统/mnt/tmp路径下,这样就能看到/mnt/tmp中有你光盘镜像文件,然后用mount -o loop /mnt/tmp/path/FC4DVD.iso /mnt/cdrom的命令将镜像挂到/mnt/cdrom目录,系统让你插光盘时应该就能选择这个/mnt/cdrom路径作为源了,你试试?
回复

使用道具 举报

 楼主| 发表于 2005-7-6 10:32:39 | 显示全部楼层
解决了,谢谢!
回复

使用道具 举报

发表于 2005-7-6 10:43:17 | 显示全部楼层
最后怎做的?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-9-24 19:16 , Processed in 0.069236 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表