2012年9月8日 星期六

[VMware][Ubuntu] How to expand VM disk on Linux

Vmware setting
VM --> Setting --> Utilities --> Expand --> adjust "Maximum disk size"

Restart the OS

In Linux OS Type
#fdisk /dev/sda
#Command (m for help): n
#Command (m for help): p (create primary)
#Command (m for help): 3 (Create /dev/sda3)
I assign the full partition to sda3.
So I press enter two times.
#Command (m for help): w (write my modify to partition)

Reboot the OS

Check the original partitiondf -T
file system      Type     1K-block      used    can use     used%   mount point
/dev/sda1        ext4    19222656     5561588  12684532    31%   /

According to file system of sda1.

Format the new partition
mkfs.ext4 /dev/sda3

method 1:
mkdir /media/happy -p
mount /dev/sda3 /media/happy (mount /dev/sda3 to /media/happy)

method 2:
When System start up, system will mount automatically
mkdir /media/happy -p
cp /etc/fstab /etc/fstab.bak
vim /etc/fstab
Add "/dev/sda3    /media/happy ext4 defaults 0 0"
mount -a (auto mount when don't want to restart OS)

When OS start, ln will link automatic

Fedora 12

vim /etc/rc.d/rc.local
Add
ln -sf /media/happy /home/user/happy

When OS restart
cd /home/user/happy will be linked automatically


Reference :

Related Posts:

0 意見:

張貼留言