首先,查看系统的磁盘代号:
fdisk -l Disk /dev/sda: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors Units = 扇区 of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000214d1 设备 启动 起点 终点 块数 Id 系统 /dev/sda1 * 2048 217925631 108961792 83 Linux /dev/sda2 217927678 234440703 8256513 5 扩展 /dev/sda5 217927680 234440703 8256512 82 Linux 交换 / Solaris Disk /dev/sdb: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors Units = 扇区 of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0xec689ddc 设备 启动 起点 终点 块数 Id 系统 /dev/sdb1 2052 471040703 235519326 7 HPFS/NTFS/exFAT 分区 1 未起始于物理扇区边界。 /dev/sdb2 471040704 976770467 252864882 7 HPFS/NTFS/exFAT Disk /dev/sdc: 8178 MB, 8178892800 bytes 92 heads, 57 sectors/track, 3046 cylinders, total 15974400 sectors Units = 扇区 of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x16c0ca45 设备 启动 起点 终点 块数 Id 系统 /dev/sdc1 * 1552 15974399 7986424 b W95 FAT32注意:根目录/一定要先于其他目录被挂载起来。
其他的挂载点必须为已创建好的目录。
使用如下命令查看其他磁盘的UUID:
sudo blkid结果如下:
/dev/sda1: UUID="70fb376c-17c2-4ce1-a263-727f647949cf" TYPE="ext4" /dev/sda5: UUID="0c5f073a-ad3f-414f-85c2-4af83f6a437f" TYPE="swap" /dev/sdb1: UUID="11263962-9715-473f-9421-0b604e895aaa" TYPE="ext4" /dev/sdb2: UUID="88928fea-5dd3-47b1-9931-bb107d74371e" TYPE="ext4"接下来修改自动挂载的配置文件:
sudo vim /etc/fstab修改如下:
UUID=70fb376c-17c2-4ce1-a263-727f647949cf / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=0c5f073a-ad3f-414f-85c2-4af83f6a437f none swap sw 0 0 UUID=11263962-9715-473f-9421-0b604e895aaa /data ext4 defaults 0 1 UUID=88928fea-5dd3-47b1-9931-bb107d74371e /export ext4 defaults 0 1最后两行为新加的挂载点。