Extend /dev/sda space
Hello,
Please would you help me on this, I want to extend the space for /dev/sda but I am afraid. When I execute Code:
[root@NewGen ~]# lsblk -f I see that /dev/sda is being used, but when I run fdisk -l, I cannot see any primary partition created, for example /dev/sda1.. : Code:
[root@NewGen ~]# fdisk -l Does this mean that the physical partition /dev/sda has never been extended ? Also, I need to extend the space on that physical partition. I have increased the space in VMware, and now I want to create in Linux the physical partition /dev/sda1 as Linux LVM 8e. Is this ok? Many Thanks!! |
Quote:
In your case that disk has not been partitioned but made into an LVM "Physical Volume", in which lv's (logical volumes) have been created. Their device files look like /dev/dm* (device mapper) and are managed through the LVM tools. Find a good tutorial about LVM2, especially in combination with your distribution. |
lsblk is showing that you are using LVM2. LVM = Logical Volume Manager
In LVM you add disks or partitions as PVs (Physical Volumes) to a VG (Volume Group). You can then subdivide the VG into LVs (Logical Volumes). Since fdisk shows no partitions on sda it means the entire disk is a PV. The line: Quote:
Since sda was used as the PV there is no additional space available from sda to add a partition. However, since your filesystem is in LVM you may be able to extend the LV if the VG has free space. Failing that you'd have to add another disk to the system since lsblk shows sda fully allocated to LVM and fdisk -l shows sdb fully allocated to partitions (some of which are in LVM but a separate VG named vg_newgen). With a new disk you can add it as a PV to vg_oracle. Run the following commands and provide the output: vgs = Shows your defined VGs and whether any space is available to add to the LVs pvs = Shows which devices (disks or partitions are in use) lvs = Shows your defined LVs with sizes df -hP = Shows your mounted filesystem directories with sizes and the devices (e.g. LVs) they are mounted from. You might want to read up on LVM and the manual page is a good place to start. Type: man lvm |
Hi,
Results below: Code:
[root@NewGen ~]# vgs |
That output confirms you've allocated all of both disks to 2 separate VGs and have allocated 100% of VGs to LVs. There is no space in partitions.
It does show that you allocated your root (/) filesystem as 356GB but it contains only 130GB of files/data and has 222GB free. That filesystem is in VG, vg_newgen, which is comprised of two separate PVs, /dev/sdb2 & /dev/sdb4. Also I notice your df output doesn't show anything for /dev/sdb3 but your lsblk earlier shows it formated for ext4 (not as part of LVM). Do you know what that is used for? Ideally what you would do at this point is add a new disk to the system (are these internal disks? You can find out by running lsscsi command. If you can't add another disk your options are: 1) If /dev/sdb3 is unused you could change its type to LVM2 then pvcreate it then vgextend it into vg_oracle (type "man" on each of the commands for details, e.g. "man pvcreate". Do NOT do this unless you're sure it isn't used for the images the label implies. 2) You could work on reducing the size of the root filesytem and its LV to only use the space allowed by sdb4 then plan to pvmove to move extents from /dev/sdb2 to /dev/sdb4, use vgremove to remove sdb2 from vg_newgen then vgextend to add to sdb2 to vg_oracle. Since this is the root filesystem you'd likely have to plan on reducing it in single user mode. Not a light undertaking. 3) If there are subdirectories in /u01/app/oracle/oradata filesystem that aren't actually data (e.g. the oracle binaries themselves) you could cheat by moving them to a new subdirectory of root (/) such as /u01/app/oracle/ora2 then make a symbolic link of that to the subdirectory they had in the above filesystem: e.g. If you had /u01/app/oracle/oradata/appl_top you could create /u02/app/oracle/ora2/appl_top then link them. I suspect however, your binaries and non data files are already in the root filesystem somewhere under /u02/app/oracle. Any of these would require careful planning. For option 2 you'd have to shutdown everything. For option 3 you'd likely have to shutdown Oracle. This is why I say option 1 is the ideal way to go. The only downtime would be to add a physical disk to the system. All the configuration after that can be done online. If it is a SAN disk it doesn't even require the downtime to add the LUN as that can be done online. |
I suspect the OP has made the virtual disk bigger - /dev/sda is 536.9 GB but the pv is only 200 G; probably the original size of the disk. "pvresize /dev/sda" will expand the pv to the size of the disk. Then the vg and lv can be enlarged.
|
Quote:
He'd need to do a pvresize A good write-up I found some time ago on that by Earl C. Ruby III is at: http://earlruby.org/2010/10/increasi...out-rebooting/ Since multipathing doesn't appear to be in use the OP can ignore that part. Quote:
|
Hello,
Hm.. I am a little confused now. What I have done till now is: I have increased the size of /dev/sda from 200GB to 536.9GB from VMware. Now, I want to create a new primary partition type 8e named /dev/sda1, and then increase VG and then LV. Is this OK? or I am missing something? Many thanks for your support! |
Quote:
As noted by syg00: Quote:
|
This was helpful to me:
How to Increase the size of a Linux LVM by expanding the virtual machine disk https://www.rootusers.com/how-to-inc...-machine-disk/ |
Quote:
To re-iterate to OP: Do NOT try to partition /dev/sda - you are using the entire disk as a PV, not partitions from it. If you try to partition it you risk destroying existing LVM information. Just do the pvresize and other steps. |
All times are GMT -5. The time now is 04:30 PM. |