首先将USB设备插到USB口上,我在我的机器上插入了一个USB硬盘,和一个SD卡,其中SD卡已经挂接到Ubuntu Linuxx系统。然后在终端中输入
$ sudo fdisk -l
会看到以下显示:
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc9c6c9c6
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2550 20482843+ 7 HPFS/NTFS
/dev/sda2 2551 19457 135805477+ f W95 Ext’d (LBA)
/dev/sda5 2551 6374 30716248+ b W95 FAT32
/dev/sda6 6375 10198 30716248+ b W95 FAT32
/dev/sda7 10199 19457 74372886 7 HPFS/NTFS
Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xbfcf3908
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 3824 30716248+ 7 HPFS/NTFS
/dev/sdb2 3825 14592 86493960 f W95 Ext’d (LBA)
/dev/sdb5 3825 8923 40957686 7 HPFS/NTFS
/dev/sdb6 8924 14592 45536211 7 HPFS/NTFS
Disk /dev/sdc: 2032 MB, 2032664576 bytes
41 heads, 40 sectors/track, 2420 cylinders
Units = cylinders of 1640 * 512 = 839680 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdc1 1 2421 1984899+ 6 FAT16
其中:
Disk /dev/sdb: 120.0 GB是我的移动硬盘
Disk /dev/sdc: 2032 MB是我的SD卡
继续执行
$ mount
会看到一下显示
/host/ubuntu/disks/root.disk on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.24-19-generic/volatile type tmpfs (rw)
/host/ubuntu/disks/boot on /boot type none (rw,bind)
securityfs on /sys/kernel/security type securityfs (rw)
gvfs-fuse-daemon on /home/guandl/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=guandl)
/dev/sdc1 on /media/disk type vfat (rw,nosuid,nodev,uhelper=hal,shortname=mixed,uid=1000,utf8,umask=077,flush)
从以上内容可以看到/dev/sdc1(SD卡)挂接在/media/disk,下面我们将/dev/sdb1到Linux
首先创建一个挂接点,也就是目录
$ sudo mkdir /mnt/mvdisk-1
然后执行mount挂接
$ sudo mount /dev/sdb1 /mnt/mvdisk-1/
查看挂接点的内容
$ ls -l /mnt/mvdisk-1/
会看到类似一下内容
总用量 64
drwxrwxrwx 1 root root 61440 2008-09-23 20:43 books
drwxrwxrwx 1 root root 4096 2008-09-06 17:07 System Volume Information
再查看所有挂接设备
$ mount
/host/ubuntu/disks/root.disk on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.24-19-generic/volatile type tmpfs (rw)
/host/ubuntu/disks/boot on /boot type none (rw,bind)
securityfs on /sys/kernel/security type securityfs (rw)
gvfs-fuse-daemon on /home/guandl/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=guandl)
/dev/sdc1 on /media/disk type vfat (rw,nosuid,nodev,uhelper=hal,shortname=mixed,uid=1000,utf8,umask=077,flush)
/dev/sdb1 on /mnt/mvdisk-1 type fuseblk (rw,nosuid,nodev,noatime,allow_other,blksize=4096)
可以看到,/dev/sdb1已经挂接到了/mnt/mvdisk-1
断开挂接
$ sudo umount /mnt/mvdisk-1
再查看所有挂接设备
$ mount
/host/ubuntu/disks/root.disk on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.24-19-generic/volatile type tmpfs (rw)
/host/ubuntu/disks/boot on /boot type none (rw,bind)
securityfs on /sys/kernel/security type securityfs (rw)
gvfs-fuse-daemon on /home/guandl/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=guandl)
/dev/sdc1 on /media/disk type vfat (rw,nosuid,nodev,uhelper=hal,shortname=mixed,uid=1000,utf8,umask=077,flush)
可以看到,/dev/sdb1已经不在挂接范围了