LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2036|回复: 15

如何在linux中mount FREEBSD分区?

[复制链接]
发表于 2003-12-11 21:06:26 | 显示全部楼层 |阅读模式
在BSD中可以通过编译内核来mount ext3/2分区.可是在linux下如何mountBSD分区呢?我想最大的困难在于BSD的分区是slice的.而在linux中根本不认这些slice而一认成一个BSD分区.请问如何在linux中mount FREEBSD分区?
发表于 2003-12-11 21:39:53 | 显示全部楼层
linux对FreeBSD分区的支持不好, 还是别想了!最好是都使用一个使用fat32格式的共享分区。
 楼主| 发表于 2003-12-11 22:13:19 | 显示全部楼层
BSD的是默认是UFS文件系统吧。不知现在的内核支持不?要是可以的话直接在linux内核编译时加上UFS支持就行了。我到LINUX下看看内核支不支持先。
 楼主| 发表于 2003-12-11 22:17:59 | 显示全部楼层
我看过了有
默认的是only read。我试试先
发表于 2003-12-12 00:47:14 | 显示全部楼层
mount -t ufs -o ufstype=44bsd /dev/hdaX /mnt
but with fbsd 5.x, I'm not sure this still works... since freebsd 5.x use ufs2 instead of ufs .
 楼主| 发表于 2003-12-12 09:38:49 | 显示全部楼层
[root@linuxboy root]# fdisk -l

Disk /dev/hda: 33.8 GB, 33820286976 bytes
255 heads, 63 sectors/track, 4111 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1       574   4610623+   b  Win95 FAT32
/dev/hda2           575      4111  28410952+   f  Win95 Ext'd (LBA)
/dev/hda5           575       829   2048256    b  Win95 FAT32
/dev/hda6           830      2869  16386268+   b  Win95 FAT32
/dev/hda7          2870      3507   5124703+   b  Win95 FAT32
/dev/hda8          3508      4111   4851598+  83  Linux

Disk /dev/hdb: 20.0 GB, 20020396032 bytes
240 heads, 63 sectors/track, 2586 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hdb1             1      1084   8193118+  83  Linux
Partition 1 does not end on cylinder boundary.
/dev/hdb2          1084      1842   5727172+   f  Win95 Ext'd (LBA)
Partition 2 does not end on cylinder boundary.
/dev/hdb3   *      1842      2587   5630845+  a5  FreeBSD
Partition 3 does not end on cylinder boundary.
/dev/hdb5          1084      1761   5116671   83  Linux
/dev/hdb6          1761      1842    610438+  82  Linux swap
[root@linuxboy root]# cd /mnt
[root@linuxboy mnt]# ls
cdrom/   freebsd/   windows1/  windows3/  windows6/
floppy/  windows0/  windows2/  windows5/  windows8/
[root@linuxboy mnt]# mount -t ufs -o ufstype=44bsd /dev/hdb3 /mnt/freebsd
mount: wrong fs type, bad option, bad superblock on /dev/hdb3,
       or too many mounted file systems
[root@linuxboy mnt]#
 楼主| 发表于 2003-12-12 09:42:21 | 显示全部楼层
好像行不通
发表于 2003-12-12 10:41:42 | 显示全部楼层
这么大的硬盘, 分个fat32格式的分区来在各系统间传递文件!
发表于 2003-12-12 16:42:02 | 显示全部楼层
well, your freebsd slice is hdb3 (view by linux), but this slice include  normal partition (/, /usr...etc...) and also swap for freebsd, so "mount -t ufs -o ufstype=44bsd /dev/hdb3 /mnt/freebsd" will not work.

The best way is rainren's methode : "create at least a slice for data (with fat32 or ufs , not ufs2)" and according to your config to remount it.
 楼主| 发表于 2003-12-12 18:24:35 | 显示全部楼层
收到.我去看了freebsd-howto,里面说mount ufs2要用这样的命令
mount -t u2fs  /dev/hd?? /mnt/freebsd
它会包括所有的slice 而这个功能必须要求内核2.1.87以上.可是我的内核已是最新的了(2.6)还是不能用这个.要下载个ufs的补丁才行.可是我找不能.howto原文如下
5. Mounting filesystems
5.1 Mounting UFS filesystems under Linux
Unfortunately the UFS driver in the Linux 2.0.xx kernels do not include support for FreeBSD. When you try to mount a FreeBSD filesystem, you just get some error messages (the filesystem actually gets mounted, but you cannot do anything with it.) This problem has been solved in the newer Linux kernels (version 2.1.87 and higher.)

There is another version of the UFS driver for Linux 2.0.xx kernels (xx <= 30) on SunSite. It is called U2FS and the current version is u2fs-0.4.3.tar.gz. A version of U2FS (ufs-0.4.4.tar.gz) for Linux 2.0.31 and higher (2.0.xx; not 2.1.xx) can be found at this site along with further information about U2FS (and UFS.)

Now you have to build a new kernel with support for the U2FS filesystem and BSD disklabels. See section Installing and preparing Linux for more information on this. You can leave out UFS filesystem support from the kernel when you use U2FS.

When you have installed the new kernel, you can mount your UFS filesystems (all the partitions in the FreeBSD slice except the swap partition) with a command like this:

mount -t u2fs /dev/hda8 /mnt

You should use a command like

mount -t ufs /dev/hda8 /mnt

if you use a Linux kernel version 2.1.87 or higher.
The UFS (and U2FS) driver is read-only. That is; you can read from the UFS filesystems but you cannot write to them. An experimental read-write UFS driver has replaced the read-only driver in Linux kernels version 2.1.112 and higher; writing to FreeBSD partitions is supported from version 2.1.127.

我的英语很不好.不知我的理解有没有错呢?里面只是说可能解决.
请问那个网站比较好下载tar.gz文件.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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