掛載與查看行動裝置

來源:互聯網
上載者:User
Linux:掛接(mount)命令的使用方法 (掛接移動硬碟)2008-07-21 12:19 掛接移動硬碟

  對linux系統而言,USB介面的移動硬碟是當作SCSI裝置對待的。插入移動硬碟之前,應先用fdisk –l
或 more /proc/partitions查看系統的硬碟和硬碟分區情況。

  [root at pldyrouter /]# fdisk -l

  Disk /dev/sda: 73 dot 4 GB, 73407820800 bytes

  255 heads, 63 sectors/track, 8924 cylinders

  Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot Start End Blocks Id System

  /dev/sda1 1 4 32098+ de Dell Utility

  /dev/sda2 * 5 2554 20482875 7 HPFS/NTFS

  /dev/sda3 2555 7904 42973875 83 Linux

  /dev/sda4 7905 8924 Win95 Ext'd (LBA)

  /dev/sda5 7905 8924 8193118+ 82 Linux swap

  在這裡可以清楚地看到系統有一塊SCSI硬碟/dev/sda和它的四個磁碟分割/dev/sda1 -- /dev/sda4, /dev/sda5是分區/dev/sda4的邏輯分區。接好移動硬碟後,再用fdisk –l
或 more /proc/partitions查看系統的硬碟和硬碟分區情況

  [root at pldyrouter /]# fdisk -l

  Disk /dev/sda: 73 dot 4 GB, 73407820800 bytes

  255 heads, 63 sectors/track, 8924 cylinders

  Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot Start End Blocks Id System

  /dev/sda1 1 4 32098+ de Dell Utility

  /dev/sda2 * 5 2554 20482875 7 HPFS/NTFS

  /dev/sda3 2555 7904 42973875 83 Linux

  /dev/sda4 7905 8924 Win95 Ext'd (LBA)

  /dev/sda5 7905 8924 8193118+ 82 Linux swap

  Disk /dev/sdc: 40.0 GB, 40007761920 bytes

  255 heads, 63 sectors/track, 4864 cylinders

  Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot Start End Blocks Id System

  /dev/sdc1 1 510 4096543+ 7 HPFS/NTFS

  /dev/sdc2 511 4864 Win95 Ext'd (LBA)

  /dev/sdc5 511 4864 34973473+ b Win95 FAT32

  大家應該可以發現多了一個SCSI硬碟/dev/sdc和它的兩個磁碟分割/dev/sdc1?、/dev/sdc2,其中/dev/sdc5是/dev/sdc2分區的邏輯分區。我們可以使用下面的命令掛接/dev/sdc1和/dev/sdc5。

   #mkdir -p /mnt/usbhd1

   #mkdir -p /mnt/usbhd2

   註:建立目錄用來作掛接點(mount point)

   #mount -t ntfs /dev/sdc1 /mnt/usbhd1

   #mount -t vfat /dev/sdc5 /mnt/usbhd2

   註:對ntfs格式的磁碟分割應使用-t ntfs
參數,對fat32格式的磁碟分割應使用-t vfat參數。若漢字檔案名稱顯示為亂碼或不顯示,可以使用下面的命令格式。

   #mount -t ntfs -o iocharset=cp936 /dev/sdc1 /mnt/usbhd1

   #mount -t vfat -o iocharset=cp936 /dev/sdc5 /mnt/usbhd2

  linux系統下使用fdisk分區命令和mkfs檔案系統建立命令可以將移動硬碟的分區製作成linux系統所特有的ext2、ext3格式。這樣,在linux下使用就更方便了。使用下面的命令直接掛接即可。

   #mount /dev/sdc1 /mnt/usbhd1 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.