首页 > 数据库 > Oracle > 虚拟磁盘空间满后的扩展方法
前几天发现VMware虚拟机上安装Grid的数据/u01区满了,具体处理过程可以认为如下两个步骤。
1、将VMware上的虚拟关闭后,在虚拟机OS对应的连接上单击鼠标右键,选择setting...,在弹出窗口中选中Hard Disk,在窗口右边会发生变化,其中选择utilities对应下拉菜单中的Expand,弹出表单中输入容量,然后单击Expand按钮。
重启虚拟机后发现,分区没有扩展。
这个时候我们目的可能是扩展已满的分区,但是实现起来要做的应该是在增加新的分区并将部分文件已过去来平衡空间问题。
2、以上步骤完成后,具体新增分区并挂在的过程的操作步骤如下:
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博客 ” ,链接:https://blog.itpub.net/18841027/viewspace-1059933/ ,如需转载,请注明出处,否则将追究法律责任。