虛擬磁碟空間滿後的擴充套件方法

kuqlan發表於2012-12-16

前幾天發現VMware虛擬機器上安裝Grid的資料/u01區滿了,具體處理過程可以認為如下兩個步驟。
1、將VMware上的虛擬關閉後,在虛擬機器OS對應的連線上單擊滑鼠右鍵,選擇setting...,在彈出視窗中選中Hard Disk,在視窗右邊會發生變化,其中選擇utilities對應下拉選單中的Expand,彈出表單中輸入容量,然後單擊Expand按鈕。
重啟虛擬機器後發現,分割槽沒有擴充套件。
這個時候我們目的可能是擴充套件已滿的分割槽,但是實現起來要做的應該是在增加新的分割槽並將部分檔案已過去來平衡空間問題。
2、以上步驟完成後,具體新增分割槽並掛在的過程的操作步驟如下:

[@more@]

Last login: Sat Dec 15 06:15:45 2012 from 10.7.191.100
[oracle@ocm2 ~]$ su - root
Password:
[root@ocm2 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 6.7G 3.7G 2.7G 59% /
/dev/sda2 12G 4.7G 6.6G 42% /u01
tmpfs 1014M 0 1014M 0% /dev/shm


[root@ocm2 ~]# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 892 7164958+ 83 Linux
/dev/sda2 893 2480 12755610 83 Linux
/dev/sda3 2481 2610 1044225 82 Linux swap / Solaris
[root@ocm2 ~]# fdisk /dev/sda

The number of cylinders for this disk is set to 3916.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Selected partition 4
First cylinder (2611-3916, default 2611):
Using default value 2611
Last cylinder or +size or +sizeM or +sizeK (2611-3916, default 3916):
Using default value 3916

Command (m for help): p

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 892 7164958+ 83 Linux
/dev/sda2 893 2480 12755610 83 Linux
/dev/sda3 2481 2610 1044225 82 Linux swap / Solaris
/dev/sda4 2611 3916 10490445 83 Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@ocm2 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 6.7G 3.7G 2.7G 59% /
/dev/sda2 12G 4.7G 6.6G 42% /u01
tmpfs 1014M 0 1014M 0% /dev/shm
[root@ocm2 ~]# reboot

Broadcast message from root (pts/0) (Sat Dec 15 19:40:27 2012):

The system is going down for reboot NOW!
[root@ocm2 ~]#
Last login: Sat Dec 15 19:35:57 2012 from 10.7.191.100
[oracle@ocm2 ~]$ su - root
Password:
[root@ocm2 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 6.7G 3.7G 2.7G 59% /
/dev/sda2 12G 4.6G 6.7G 41% /u01
tmpfs 1014M 0 1014M 0% /dev/shm
[root@ocm2 ~]# fdisk -

Unable to open -
[root@ocm2 ~]# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 892 7164958+ 83 Linux
/dev/sda2 893 2480 12755610 83 Linux
/dev/sda3 2481 2610 1044225 82 Linux swap / Solaris
/dev/sda4 2611 3916 10490445 83 Linux
[root@ocm2 ~]# mkfs -t ext3 /dev/sda4
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1311552 inodes, 2622611 blocks
131130 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2688548864
81 block groups
32768 blocks per group, 32768 fragments per group
16192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@ocm2 ~]#


[root@ocm2 ~]# mkfs -t ext3 /dev/sda4
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1311552 inodes, 2622611 blocks
131130 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2688548864
81 block groups
32768 blocks per group, 32768 fragments per group
16192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@ocm2 ~]# more /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/u01 /u01 ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda3 swap swap defaults 0 0
[root@ocm2 ~]# mdkir /u02
-bash: mdkir: command not found
[root@ocm2 ~]# mkdir /u02
[root@ocm2 ~]# mount /dev/sda4 /u02
[root@ocm2 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 6.7G 3.7G 2.7G 59% /
/dev/sda2 12G 4.6G 6.7G 41% /u01
tmpfs 1014M 0 1014M 0% /dev/shm
/dev/sda4 9.9G 151M 9.3G 2% /u02

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18841027/viewspace-1059933/,如需轉載,請註明出處,否則將追究法律責任。

相關文章