標籤:io 使用 ar for 檔案 art sp log on
1, 首先摸清我系統的硬碟分區等使用方式
sudo fdisk -l
Disk /dev/sda: 128.0 GB, 128035676160 bytes
255 heads, 63 sectors/track, 15566 cylinders, total 250069680 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00097397
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 233476095 116737024 83 Linux
/dev/sda2 233478142 250068991 8295425 5 Extended
/dev/sda5 233478144 250068991 8295424 82 Linux swap / Solaris
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x621867fe
Device Boot Start End Blocks Id System
/dev/sdb1 * 63 92164904 46082421 7 HPFS/NTFS/exFAT
Partition 1 does not start on physical sector boundary.
/dev/sdb2 92166144 840998911 374416384 83 Linux
/dev/sdb3 841003008 976773167 67885080 7 HPFS/NTFS/exFAT
sudo blkid
/dev/sda1: UUID="d89cb536-6aee-4f32-90de-7f1d50c56028" TYPE="ext4"
/dev/sda5: UUID="23776989-f354-4ffc-9d3b-c299afe9c6dd" TYPE="swap"
/dev/sdb1: UUID="D6B6542EB65410FB" TYPE="ntfs"
/dev/sdb2: LABEL="woks" UUID="6e29fd49-6443-4048-bc4d-d9a391bf2ce9" TYPE="ext4"
/dev/sdb3: LABEL="winapp" UUID="1ADE5534DE550981" TYPE="ntfs"
我需要掛在的是sdb2和sdb3這兩個分區
2,修改分區掛在配置表
開啟/etc/fstab
設定檔包含以下幾項:
<file system> <mount point> <type> <options> <dump> <pass>
<file system> :分區定位,可以給磁碟號,UUID或LABEL,例如:/dev/sda2,UUID=6E9ADAC29ADA85CD或LABEL=software
<mount point> : 具體掛載點的位置,例如:/media/C
<type> : 掛載磁碟類型,linux分區一般為ext4,windows分區一般為ntfs
<options> : 掛載參數,一般為defaults
<dump> : 磁碟備份,預設為0,不備份
<pass> : 磁碟檢查,預設為0,不檢查
根據情況,我們做如下修改
# /etc/fstab: static file system information.
#
# Use ‘blkid‘ to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=d89cb536-6aee-4f32-90de-7f1d50c56028 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=23776989-f354-4ffc-9d3b-c299afe9c6dd none swap sw 0 0
#work was on /dev/sdb2
UUID=6e29fd49-6443-4048-bc4d-d9a391bf2ce9 /media/zangcf/works ext4 errors=remount-ro 0 0
#winapp was on /dev/sdb3
UUID=1ADE5534DE550981 /media/zangcf/winapp ntfs errors=remount-ro 0 0
3, 檢查並掛載新添項
手動卸載已經掛載的硬碟,然後
cd /media/zangcf
sudo mkdir winapp
sudo mkdir works
sudo mount -a
mount -a會/etc/fstab中的項全部掛載,如果有錯,則會提示錯誤,然後根據錯誤找出原因修改。
【轉】ubuntu下自動掛載硬碟分區