linux下挂载windows扇区

    随着linux的普及,越来越多的人在安装windows的同时,也会装上linux系统体验一下。由于我们对windows环境已经比较熟悉,因此我们的文件大多是保存在windows环境下。那么如果我们在玩linux的时候想访问自己的文件时怎么办呢?
这就要靠强大的linux大大提供的mount命令了。用mount命令我们可以很容易地访问windows特有格式(如FAT32,NTFS等等)的分区。

1.首先,我们用fdisk命令查看硬盘的分区情况。

[root @root ]# fdisk –l /dev/hda
Disk /dev/hda: 255 heads, 63 sectors, 524 cylinders 
Units = cylinders of 16065 * 512 bytes 
   Device Boot    Start       End    Blocks   Id  System 
/dev/hda1             1       268   2152678+  83  Win95 FAT32 
/dev/hda2   *       269       395   1020127+  83  Linux 
/dev/hda3           396       459    514080   83  Linux 
/dev/hda4           460       524    522112+   5  Extended 
/dev/hda5           460       472    104391   83  Linux 
/dev/hda6           473       485    104391   83  Linux 
/dev/hda7           486       498    104391   82  Linux swap 
/dev/hda8           499       511    104391   83  Linux 
/dev/hda9           512       524    104391   83  Linux

看到Win95 FAT32 没?这个就是我们要找的东东,有时我们也会看到HPFS/NTFS,这个也是windows常用的。

2.找到后,我们就可以用mount命令进行挂载了。挂载需要一个挂载点,比如我们打算挂载Windows下的C:盘,我们需要使用命令
mkdir /mnt/win/C
建立一个文件夹,就将C盘挂载在这个地方,执行
mount -t vfat /dev/hda1 /mnt/win/C
就成功地将C盘挂载在/mnt/win/C目录下了

然后我们就可以继续挂载D盘,E盘了...

 

mount命令语法

[root @test /root ]# mount [-ahlV] 
[root @test /root ]# mount -t type /dev/hdxx /mountpoint
[root @test /root ]# mount -o [options]
[root @test /root ]# umount /mountpoint
参数说明:
-a   :依照 /etc/fstab 的内容将所有相关的磁盘都挂上来!
-h   :只列出 mount 相关的参数,并不挂载任何装置
-l   :列出目前已经挂载的装置、档案系统名称与挂载点!
-V   :列出 mount 的版本信息
type :将后面 /dev/hdxx 这个装置以 type 的档案格式挂载到 /mountpoint 这个点,
      常见的 type 有底下几个:
      vfat, msdos       :这个是支持 Windows 系统的档案格式,尤其是 vfat 常用!
      ext, ext2         :这个就是 Linux 的主要档案格式啦!
      iso9660           :光驱的档案格式
      nfs, ntfs, ufs    :Windows 2000 使用 NTFS 格式呀!
-o  :这个参数后面接的咚咚可多了!可用的资料可不少呢!
   rw   :让 mount 的扇区为可擦写
   suid   :允许该扇区可以设定档案为 SUID 的状态!
   exec   :允许该扇区可以执行 binary 的档案!
   auto   :允许该扇区可以使用 mount -a 的参数设定!
   nouser :禁止其它人(非 root 之使用者)使用挂载功能!这是默认值!
   async :允许扇区可以进行异步记录(内存与硬盘不同步!最常用!)
   defaults:同时具有 rw, suid, dev, exec, auto, nouser, async 这些功能的设定值!
   nosuid :不许该扇区具有 SUID 的档案属性!
   ro   :设定为只读属性!
   remount :让系统本来挂载的扇区重新被挂载!
范例:
[root @test /root]# mount -a
[root @test /root]# mount -t iso9660 /dev/cdrom /mnt/cdrom<==挂上光盘
[root @test /root]# mount -t vfat /dev/fd0 /mnt/floppy   <==挂上 windows 档案系统的软盘
[root @test /root]# mount -t ext2 /dev/fd0 /mnt/floppy   <==挂上 Linux   档案系统的软盘
[root @test /root]# mount -t ext2 /dev/hdc6 /home        <==挂上 Linux 档案格式硬盘
[root @test /root]# mount -o remount,rw /          <==让根目录重新挂载为可读!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值