oracle拓展磁盘空间,OracleVM扩容磁盘空间-Oracle

本文详细介绍了如何在Oracle VM环境下扩展虚拟机硬盘空间。首先通过VBoxManage命令找到需要扩容的UUID并执行扩容操作,接着进入Linux系统,使用fdisk创建新的分区,并将其格式化为ext4文件系统。最后,挂载新分区并在/etc/fstab中配置开机自动挂载,确保扩容后的空间在系统启动时能够正常使用。
摘要由CSDN通过智能技术生成

在Oracle VM时,意外发现空间小了,不想重装,只好扩容了。 还好Oracle VM算比较好用,就扩容一下。步骤如下: 1. 查出要增加容量的映像的uuid C:\Users\XCL>cd C:\Program Files\Oracle\VirtualBox

C:\Program Files\Oracle\VirtualBox>vboxmanage list hdds UUID: dc54c773-8c62-43fe-92e2-e3e0d7ee8d5e Parent UUID: base Format: VDI Location: D:\OracleVM\11RAC1\11RAC1.vdi State: created Type: normal Usage: 11RAC1 (UUID: 2499fdd3-5595-4260-b1c0-12472a44b53f)

2.给查出的UUID扩容。 扩容: 5242880 == 5TB 30720 = 30 GB

VBoxManage modifyhd dc54c773-8c62-43fe-92e2-e3e0d7ee8d5e –resize 5242880 也可以: VBoxManage modifyhd D:\OracleVM\11RAC1\11RAC1.vdi –resize 5242880

3.进linux,这时df是没找不到扩出来的空间的,用fdisk才可以看到。 然后fdisk 一下查出来的 /dev/sda。 a. 查看下现有的 [root@rac1 ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_xclrac1-lv_root 16G 12G 3.4G 77% / tmpfs 1004M 260K 1004M 1% /dev/shm /dev/sda1 485M 56M 404M 13% /boot

b.打印下当前分区情况 [root@rac1 ~]# fdisk -l Disk /dev/sda: 5497.6 GB, 5497558138880 bytes 255 heads, 63 sectors/track, 668373 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: 0x000eb935

c.新建主分区并保存 [root@rac1 dev]# fdisk /dev/sda WARNING: The size of this disk is 5.5 TB (5497558138880 bytes). DOS partition table format can not be used on drives for volumes larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID partition table format (GPT). WARNING: DOS-compatible mode is deprecated. It’s strongly recommended to switch off the mode (command ‘c’) and change display units to sectors (command ‘u’). Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 3 First cylinder (2611-668373, default 2611): Using default value 2611 Last cylinder, +cylinders or +size{K,M,G} (2611-267349, default 267349): Using default value 267349 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 or after you run partprobe(8) or kpartx(8) Syncing disks. c.重启。 shutdown -ry 0

4. 在/dev下,可以看到新n出来的/dev/sda3 [root@rac1 ~]# ls /dev/sd* /dev/sda /dev/sda2 /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sda1 /dev/sda3 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1

5.现在可以格式化了,首先要查出现在的系统文件格式,为分区作准备. 这里 a. df -Th b. 将分区类型改成 Linux fdisk /dev/sda -> T -> 选之前的3 -> L -> 选 83(Linux) -> w 保存即可 c. 再检查下

[root@rac1 dev]# fdisk -l Disk /dev/sda: 5497.6 GB, 5497558138880 bytes 255 heads, 63 sectors/track, 668373 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: 0x000eb935 Device Boot Start End Blocks Id System /dev/sda1 * 1 64 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 64 2611 20458496 8e Linux LVM /dev/sda3 2611 267349 2126509322+ 83 Linux

d.格式化成ext4 mkfs -t ext4 -c /dev/sda3

6. 挂载即可 mount /dev/sda3 /u01 df -Th 7. 让它以后在系统重启时,自动挂载. vi /etc/fstab #xcl /dev/sda3 /u01 ext4 defaults 0 0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值