mount

来自百合仙子's Wiki
跳转到导航 跳转到搜索

字符编码

-o iocharset=utf8 指定字符编码为UTF-8。在挂载FAT文件系统时,使用 utf8 选项。

选项

uidgid 设置被挂载设备的UIDGID

remount 用于改变已挂载设备的选项。

另见 #字符编码

挂载 img 文件

挂载原始磁盘镜像(img)文件。

查看文件类型及分区概况,文件的 file 结果为:

chromiumos.img: x86 boot sector; partition 1: ID=0x83, starthead 0, startsector 1, 1945600 sectors; partition 2: ID=0x82, starthead 0, startsector 1945601, 1945600 sectors; partition 3: ID=0x83, active, starthead 63, startsector 3891201, 1945600 sectors, code offset 0x31

查看分区类型, fdisk -l 结果为:

Disk chromiumos.img: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00000000

         Device Boot      Start         End      Blocks   Id  System
chromiumos.img1               1     1945600      972800   83  Linux
Partition 1 has different physical/logical endings:
     phys=(950, 0, 1) logical=(121, 27, 35)
Partition 1 does not end on cylinder boundary.
chromiumos.img2         1945601     3891200      972800   82  Linux swap / Solaris
Partition 2 has different physical/logical beginnings (non-Linux?):
     phys=(950, 0, 2) logical=(121, 27, 36)
Partition 2 has different physical/logical endings:
     phys=(1023, 63, 32) logical=(242, 55, 6)
Partition 2 does not end on cylinder boundary.
chromiumos.img3   *     3891201     5836800      972800   83  Linux
Partition 3 has different physical/logical beginnings (non-Linux?):
     phys=(1023, 63, 32) logical=(242, 55, 7)
Partition 3 has different physical/logical endings:
     phys=(1023, 63, 32) logical=(363, 82, 40)
Partition 3 does not end on cylinder boundary.

挂载第一个分区:

mount -o loop,offset=512 -t ext3 /mnt

第三个:

mount -o loop,offset=1992294912 -t ext3 /mnt
#1992294912 = 512×3891201 (从 file 信息中得到)

也可以使用 partx 或者 losetup-P 选项来自动识别分区。[1]

挂载特殊的文件系统

smbfs

要先安装 smbfs 软件包。

mount -t cifs //192.168.0.2/the/folder/you/wish /your/local/folder -o user=user,passwd=passwd,iocharset=utf8

来源:LinuxTOY: Samba 服务器连接方法探讨

我的实践

sudo mount -t cifs //192.168.1.111/WFO test -o iocharset=utf8

然后会询问密码。注意这不是sudo询问的。

tmpfs

mount tmpfs ~/tmpfs -t tmpfs

也可以这样指定大小: -o size=512m

问题处理

Transport endpoint is not connected

通常这是FUSE程序给出的错误消息。要重新挂载文件系统,首先确定该程序已经不再运行,然后如下操作:

sudo umount -l /path
# Then mount it again

参见

参考资料