Chinaunix

标题: openbsd怎样mount linux系统 [打印本页]

作者: czjin    时间: 2011-01-11 16:06
标题: openbsd怎样mount linux系统
我使用openBSD系统想mount一个linux系统,但是不行,报如错误:
#
# fdisk wd1                                                            
Disk: wd1       geometry: 5169/240/63 [78165360 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
#: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
*0: 83      0  32  33 -     67 206  30 [        2048:     1024000 ] Linux files*
1: 8E     67 206  31 -   5169 137  57 [     1026048:    77137920 ] Linux LVM   
2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
3: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
#
#
# disklabel wd1
# /dev/rwd1c:
type: ESDI
disk: ESDI/IDE disk
label: WDC WD400EB-42CP
uid: 0000000000000000
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 240
sectors/cylinder: 15120
cylinders: 5169
total sectors: 78165360
boundstart: 0
boundend: 78165360
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  c:         78165360                0  unused                  
  i:          1024000             2048  ext2fs                  
  j:         77137920          1026048 unknown                  
#
#
# mount -a /dev/wd1i /mnt/use
mount_ext2fs: /dev/wd1i on /mnt/use: specified device does not match mounted device
#
#
# mount -a /dev/wd1j /mnt/use
mount_ffs: /dev/wd1j on /mnt/use: Invalid argument
#
/mnt/use是我在/mnt下建的一个目录。不知我哪里错了请大家指点。
作者: czjin    时间: 2011-01-11 16:21
我用openBSD再mount一个freebsd系统好像也不对,是如下结果:
# fdisk wd1
Disk: wd1       geometry: 5169/240/63 [78165360 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
#: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
*0: A5      0   1   1 -   5169 159  63 [          63:    78165297 ] FreeBSD     
1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
3: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
# disklabel wd1
# /dev/rwd1c:
type: ESDI
disk: ESDI/IDE disk
label: ST340015A      
uid: 0000000000000000
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 240
sectors/cylinder: 15120
cylinders: 5169
total sectors: 78165360
boundstart: 0
boundend: 78165360
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  c:         78165360                0  unused                  
  i:         78165297               63 unknown                  
# mount -a /dev/wd1i /mnt/use
mount_ffs: /dev/wd1i on /mnt/use: Device busy
#
作者: nimysun    时间: 2011-01-11 23:00
for example:
mount -t ext2fs /dev/ad6s3 /home1
作者: gvim    时间: 2011-01-12 00:30
一个是内核里有没有把支持文件系统编译进去
另一个是内核支不支持被加载的linux文件系统
作者: czjin    时间: 2011-01-12 11:05
本帖最后由 czjin 于 2011-01-12 11:18 编辑

感谢两位版主的回复,我再继续试试。以下是mount -t ext2fs /dev/wd1i /mnt/use结果:
#: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
*0: 83      0  32  33 -     67 206  30 [        2048:     1024000 ] Linux files*
1: 8E     67 206  31 -   5169 137  57 [     1026048:    77137920 ] Linux LVM   
2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
3: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  c:         78165360                0  unused                  
  i:          1024000             2048  ext2fs                  
  j:         77137920          1026048 unknown
#                  
# mount -t ext2fs /dev/wd1i /mnt/use
mount_ext2fs: /dev/wd1i on /mnt/use: specified device does not match mounted device
# mount -t ext2fs /dev/wd1j /mnt/use
mount_ext2fs: /dev/wd1j on /mnt/use: Input/output error
#
作者: czjin    时间: 2011-01-17 21:38
我在openbsd的FAQ中看到的。
14.16.1 - The partitions are not in my disklabel! What should I do?
If you install foreign filesystems on your system (often the result of adding a new operating system) after you have already installed OpenBSD, a disklabel will already be present, and it will not be updated automatically to contain the new foreign filesystem partitions. If you wish to use them, you need to add or modify these partitions manually using disklabel(.
As an example, I have modified one of my existing ext2 partitions: using Linux's fdisk program, I've reduced the size of the 'o' partition (see disklabel output above) to 1G. We will be able to recognize it easily by its starting position (offset: 6437251 and size (13783707). Note that these values are sector numbers, and that using sector numbers (not megabytes or any other measure) is the most exact and safest way of reading this information.

Before the change, the partition looked like this using OpenBSD's fdisk( utility (leaving only relevant output):

# fdisk wd0
. . .
Offset: 64372455        Signature: 0xAA55
         Starting       Ending       LBA Info:
#: id    C   H  S -    C   H  S [       start:      size   ]
------------------------------------------------------------------------
0: 83 4007   1  1 - 4864 254 63 [    64372518:    13783707 ] Linux files*
. . .

As you can see, the starting position and size are exactly those reported by disklabel( earlier. (Dont' be confused by the value indicated by "Offset": it is referring to the starting position of the extended partition in which the ext2 partition is contained.)
After changing the partition's size from Linux, it looks like this:

# fdisk wd0
. . .
Offset: 64372455        Signature: 0xAA55
         Starting       Ending       LBA Info:
#: id    C   H  S -    C   H  S [       start:      size   ]
------------------------------------------------------------------------
0: 83 4007   1  1 - 4137 254 63 [    64372518:     2104452 ] Linux files*
. . .

Now this needs to be changed using disklabel(. For instance, you can issue disklabel -e wd0, which will invoke an editor specified by the EDITOR environment variable (default is vi). Within the editor, change the last line of the disklabel to match the new size:
  o:       2104452      64372518  ext2fs

Save the disklabel to disk when finished. Now that the disklabel is up to date again, you should be able to mount your partitions as described above.
You can follow a very similar procedure to add new partitions.




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2