- 環境介紹
- 遇到的問題
- 解決辦法
回到頂部(go to top)
主機: XP
虛拟機:VirtualBox+Debian6
我有一塊西部資料的移動硬碟,虛拟機中有一些資料需要拷貝到移動硬碟中,然後我将移動硬碟插上後,執行如下設定,将移動硬碟配置設定給虛拟機:
![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLicmbw5CO3EWZhNjN0UDM0EmZzkTY2YDZ0kDN2EjN0QTNkRmYi1SNwEDN5AzNx8CXyEzMxAjMvwFO4QDM4QzLcd2bsJ2Lc12bj5ycn9Gbi52YuAzcldWYtl2Lc9CX6MHc0RHaiojIsJye.png)
然後就會将我的移動硬碟自動挂載到Debian中:
但是當我在/media/work下想建立一個檔案夾時出現如下提示:
mkdir: 無法建立目錄"debian_source": 隻讀檔案系統
安裝工具:
sudo apt-get install ntfs-config
對linux系統而言,USB接口的移動硬碟是當作SCSI裝置對待的。插入移動硬碟之前,應先用fdisk –l 或 more /proc/partitions檢視系統的硬碟和硬碟分區情況。
pengdl@debian:~$ sudo fdisk -l
[sudo] password for pengdl:
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0002d31b
Device Boot Start End Blocks Id System
/dev/sda1 1 2250 18065408 83 Linux
/dev/sda2 2250 2611 2903041 5 Extended
/dev/sda5 2250 2611 2903040 82 Linux swap / Solaris
Disk /dev/sdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0005af5f
Device Boot Start End Blocks Id System
/dev/sdb1 1 2611 20969473 5 Extended
/dev/sdb5 1 2611 20969472 83 Linux
Disk /dev/sdc: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00081b96
Device Boot Start End Blocks Id System
/dev/sdc1 1 13055 104855553 5 Extended
/dev/sdc5 1 13055 104855552 83 Linux
Disk /dev/sdd: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8196b6c7
Device Boot Start End Blocks Id System
/dev/sdd1 1 6527 52428096 83 Linux
pengdl@debian:~$
接好移動硬碟後,再用fdisk –l 或 more /proc/partitions檢視系統的硬碟和硬碟分區情況
pengdl@debian:~$ sudo fdisk -l
[sudo] password for pengdl:
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0002d31b
Device Boot Start End Blocks Id System
/dev/sda1 1 2250 18065408 83 Linux
/dev/sda2 2250 2611 2903041 5 Extended
/dev/sda5 2250 2611 2903040 82 Linux swap / Solaris
Disk /dev/sdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0005af5f
Device Boot Start End Blocks Id System
/dev/sdb1 1 2611 20969473 5 Extended
/dev/sdb5 1 2611 20969472 83 Linux
Disk /dev/sdc: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00081b96
Device Boot Start End Blocks Id System
/dev/sdc1 1 13055 104855553 5 Extended
/dev/sdc5 1 13055 104855552 83 Linux
Disk /dev/sdd: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8196b6c7
Device Boot Start End Blocks Id System
/dev/sdd1 1 6527 52428096 83 Linux
Disk /dev/sde: 1000.2 GB, 1000170586112 bytes
255 heads, 63 sectors/track, 121597 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00023f15
Device Boot Start End Blocks Id System
/dev/sde1 1 26109 209715200 7 HPFS/NTFS
/dev/sde2 26109 121598 767012864 f W95 Ext'd (LBA)
/dev/sde5 26109 121598 767012832+ 7 HPFS/NTFS
pengdl@debian:~$
大家應該可以發現多了一個SCSI硬碟/dev/sde和它的兩個磁盤分區/dev/sde1、/dev/sde2,其中/dev/sde5是/dev/sde2分區的邏輯分區。有的系統支援自動挂載,可以通過mount指令檢視自動挂載的目錄:
pengdl@debian:~$ mount
/dev/sda1 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/sdc5 on /home type ext3 (rw)
/dev/sdb5 on /usr type ext3 (rw)
/dev/sdd1 on /home/pengdl/ext_disk type ext3 (rw)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
share on /media/sf_share type vboxsf (gid=1001,rw)
/dev/sde1 on /media/entertainment type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sde5 on /media/work type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
pengdl@debian:~$
可以看到自動挂載到了/media/entertainment 和 /media/work下。進入/media/work下,發現已經可以執行寫操作了。
對于不支援自動挂載的,需要進行手動挂載:
#mkdir -p /mnt/usbhd1
mount -t ntfs /dev/sdc1 /mnt/usbhd1
注:對ntfs格式的磁盤分區應使用-t ntfs 參數。若漢字檔案名顯示為亂碼或不顯示,可以使用下面的指令格式。
mount -t ntfs -o iocharset=cp936 /dev/sdc1 /mnt/usbhd1
原文位址:https://www.cnblogs.com/pengdonglin137/p/3477869.html