ubuntu 开机自动挂载分区

作者: 云中布衣   分类:  操作系统    热度: (546℃)   时间: 2015-11-6 3:48   标签: #操作系统  #ubuntu    

问题描述:由于之前是装的win7+ubuntu双系统,绝大部分磁盘空间是在window分区下的,完全使用ubuntu之后,感觉100G的磁盘空间不够,在寻思合并分区无果之后,终于找到一个好的方法,那就是启动ubuntu时自动挂载空闲的的分区到ubuntu文件系统中就行了,完美解决。



1.首先,查看系统的磁盘代号: fdisk -l



Disk /dev/sda: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders, total 1250263728 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: 0x0003e328

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63   209728574   104864256    7  HPFS/NTFS/exFAT
/dev/sda2       209728636  1249871871   520071618    f  W95 Ext'd (LBA)
/dev/sda3      1249871872  1250263039      195584   83  Linux
/dev/sda5       209728638   461418929   125845146    7  HPFS/NTFS/exFAT
/dev/sda6       461418993   713109284   125845146    7  HPFS/NTFS/exFAT
/dev/sda7       713109348  1040549824   163720238+   7  HPFS/NTFS/exFAT
/dev/sda8      1040549888  1079611391    19530752   83  Linux
/dev/sda9      1079613440  1083516927     1951744   82  Linux swap / Solaris
/dev/sda10     1083518976  1249871871    83176448   83  Linux

注意:根目录/一定要先于其他目录被挂载起来。

其他的挂载点必须为已创建好的目录。

2.查看你需要挂载磁盘的UUID:sudo blkid


/dev/sda1: LABEL="system" UUID="C892801992800DDE" TYPE="ntfs" 
/dev/sda3: UUID="d8d3536b-2b99-41de-8eef-4252a3bc6d81" TYPE="ext4" 
/dev/sda5: LABEL="software" UUID="92C86E5BC86E3E1B" TYPE="ntfs" 
/dev/sda6: LABEL="study" UUID="C4D264F7D264EF5C" TYPE="ntfs" 
/dev/sda7: LABEL="ushare" UUID="0488561788560796" TYPE="ntfs" (这个磁盘是我需要挂载的)
/dev/sda8: UUID="dd449123-ed71-4be6-b0c9-b48159d55325" TYPE="ext4" 
/dev/sda9: UUID="5ee45d8d-331a-45e7-8043-e62d5cddde97" TYPE="swap" 
/dev/sda10: UUID="bb45dd0a-cb2a-4e9d-a487-30ae350a09f8" TYPE="ext4" 


3.修改自动挂载的配置文件:sudo vim /etc/fstab


# / was on /dev/sda8 during installation
UUID=dd449123-ed71-4be6-b0c9-b48159d55325 /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda3 during installation
UUID=d8d3536b-2b99-41de-8eef-4252a3bc6d81 /boot           ext4    defaults        0       2
# /home was on /dev/sda10 during installation
UUID=bb45dd0a-cb2a-4e9d-a487-30ae350a09f8 /home           ext4    defaults        0       2
# swap was on /dev/sda9 during installation
UUID=5ee45d8d-331a-45e7-8043-e62d5cddde97 none            swap    sw              0       0

#照葫芦画瓢,下面这两行是我添加的,为了自动挂载ushare分区
# ushare was on /dev/sda7 during installation
UUID=0488561788560796 /ushare           ntfs    defaults        0       2 



56.8K

发表评论:

© 云中布衣 2015 | Driven by EMLOG  | SiteMap | RunTime: 11.91ms&RSS  |   | 回到顶部

文章数量【230】 评论数量【156】 稳定运行【1031天】

Visitor IP Address【54.80.82.9】