Thursday, December 26, 2013

掛載Linux下未分配之磁碟空間

0

2013-12-26


前天把原本安裝雙系統(win7 & ubuntu12.04 LTS)的thinkpad x61重灌,想專心練習操作Linux,之前再用ubuntu存取win7或硬碟上剩餘空間時總會有些權限上的問題,故這次安裝時特別把磁區依照需求作調整,原本以為未分配的130G空間可以在安裝後直接使用,後來才發現用fdisk找不到,最後依照以下方法搞定:
  • use gparted to create new partition with those unlocated space


  • create a partition for this mount point
  • sudo mkdir /STORAGE
    and determine the UUID of my disk partition
    ls -l /dev/disk/by-uuid
    and get sth like this:
    [root @ 21:09 #21 /]$ ls -l /dev/disk/by-uuid
    total 0
    lrwxrwxrwx 1 root root 10 Dec 26 16:54 0fadafdb-bdce-4757-9d79-486a146ca6b9 -> ../../sda8
    lrwxrwxrwx 1 root root 10 Dec 26 16:54 1121fd2e-4309-4060-9e90-6d29126194da -> ../../sda9
    lrwxrwxrwx 1 root root 10 Dec 26 16:54 22ab174a-944d-426c-83f6-a47fdf4ade4c -> ../../sda7
    lrwxrwxrwx 1 root root 10 Dec 26 16:54 22fa8421-01e1-44ec-9ca6-df4b97c303d5 -> ../../sda1
    lrwxrwxrwx 1 root root 10 Dec 26 16:54 5a88cdde-5e33-4815-ac69-007d824466b6 -> ../../sda3
    lrwxrwxrwx 1 root root 10 Dec 26 16:54 a54b99ca-f111-4862-af5f-2d4eeeaf8646 -> ../../sda5
    lrwxrwxrwx 1 root root 10 Dec 26 16:54 d472dc2c-32fa-4867-9941-a1e95a818e88 -> ../../sda6
    lrwxrwxrwx 1 root root 11 Dec 26 16:54 e3f62ce3-c057-4548-97e6-53339095be04 -> ../../sda10
    then we need to modify /etc/fstab:
    before that,we should make a backup file
    cp -a /etc/fstab /etc/fstab_backup
    vim /etc/fstab
    and add this in line:
    UUID=5a88cdde-5e33-4815-ac69-007d824466b6 /STORAGE ext4 defaults 0 0
    the final file look like this:(last line is what i add-in)
    use 'wq' command to save the change,Since we've made changes to the /etc/fstab file, we need to have Ubuntu acknowledge those changes:
    sudo mount -a
    Now we need to give it the proper permissions.my user name is jordan so:
    sudo chown -R jordan:jordan /storage
    sudo chmod -R 755 /storage
    finally,i can install Dropbox in /STORAGE :)
    Reference:
    Mounting Linux Partitions in Ubuntu

0 comments :

Post a Comment