更改ubuntu的掛載點

我的是給ubuntu的空間太少了`但是主要工程都是在home下,所以格式化了一個空間來作爲home,然後掛載到/下

原文鏈接在此

http://hi.baidu.com/macroliu_/item/10f00f172f6076078ebde4ba

以root權限,在終端的窗口裏輸入命令,找到你要掛載的分區,這裏以sda5爲例

$ fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 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: 0xf517e314

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        5222    41945683+   7  HPFS/NTFS
/dev/sda2            5223        7712    19999744   83  Linux
/dev/sda3            7712        7961     1999872   82  Linux swap / Solaris
/dev/sda4            7962       38913   248621940    5  Extended
/dev/sda5            7962       17687    78124063+  83  Linux
/dev/sda6           17688       25520    62918541    7  HPFS/NTFS
/dev/sda7           25521       38913   107579241    7  HPFS/NTFS

這裏可以看到/dev/sda5,這應該是我想掛載在home下的分區。察看sda5的UUID

$ ls -l /dev/disk/by-uuid

看一下sda5的UUID

總計 0
lrwxrwxrwx 1 root root 10 2011-04-03 16:06 3aa554c2-e8ea-4f35-819f-7cb4573c0d67 -> ../../sda5
lrwxrwxrwx 1 root root 10 2011-04-03 16:06 4E8091348091240D -> ../../sda7
lrwxrwxrwx 1 root root 10 2011-04-03 16:06 7b1c60be-8b84-4459-9bef-9559d9431447 -> ../../sda2
lrwxrwxrwx 1 root root 10 2011-04-03 16:06 8c5324bb-9e42-422d-b507-26bafa5ac7de -> ../../sda3
lrwxrwxrwx 1 root root 10 2011-04-03 16:06 AAA87F76A87F403D -> ../../sda6
lrwxrwxrwx 1 root root 10 2011-04-03 16:06 C478ECC978ECBAF6 -> ../../sda1
將sda5的UUID填到fstab關於home的掛載那一行。


$ vim /etc/fstab 

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' 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>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda2 during installation
UUID=7b1c60be-8b84-4459-9bef-9559d9431447 /               ext4    errors=remount-ro 0       1
# /home was on /dev/sda5 during installation
UUID=3aa554c2-e8ea-4f35-819f-7cb4573c0d67 /home           ext4    defaults        0       2
# /windows was on /dev/sda6 during installation
# UUID=50C5-059A /windows        vfat    utf8,umask=007,gid=46 0       1
# swap was on /dev/sda3 during installation
UUID=8c5324bb-9e42-422d-b507-26bafa5ac7de none            swap    sw              0       0
另外,windows這個掛載點我不需要了,將fstab對應那幾行用#號注掉。

恩``那就好了``

這裏還順帶解決了開機之後差看不到windows分區的問題

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章