It looks like you already created the physical volumes. What does pvs display?
It's not totally clear what you are asking, but if I understand, you want to "combine" the disks /dev/sdb and /dev/sdc. You can do this in as much as adding them to the same volume group.
# vgcreate myvg01 /dev/sdb /dev/sdc
You can then create three logical volumes, one each for /u01, /u02 and /u03
THanks for reply.
I f I want part of the physical disk to have 2 volumes.
example: /dev/sdb device will have /dev/sdb1 and dev/sdb2
Now what I am doing is first assigning u02 (/dev/sdb1) with 60G and whatever is remaining to u01(/sdb/u02)... I got error after doing below steps while creating u01. The error is after the procedure mentioned bellow
fdisk /dev/sdb
n
p
1
t
8e
w
# Create new LVM Physical Volume
pvcreate /dev/sdb1
# Extend LVM Volume Group to new Physical Volume
vgextend VolGroup00 /dev/sdb1
# Make /u04 folder
mkdir -p /u02
# Create VolGroup00-LogVolU02
lvcreate -L 60G -n LogVolU02 VolGroup00
# Format newly created LogVolu02
mkfs -text3 /dev/VolGroup00/LogVolU02
# Add LogVolU02 to /etc/fstab
echo -e "/dev/VolGroup00/LogVolU02\t/u02\t\text3\tdefaults\t1 2" >> /etc/fstab
# Mount all Volumes
mount -a
# pvcreate /dev/sdb2
Device /dev/sdb2 not found (or ignored by filtering).
I don't see the point, really, in partitioning a physical volume in this way. You either use LVM or you don't. I also don't remember the last time I used fdisk since using LVM!
Why not just give sdb over to the logical volume manager and create logical volumes for u01, u02 and u03? That's what LVM is for. fdisk is, IMO, archaic and past its time.
Now I need to shut down my VM, add a disk and try to remember how to use fdisk!. BRB
That's not really what you asked, but it was useful for me
It looks to me like your sdb1 is using up the whole disk. That doesn't help you if you want sdb1 to be 110GB and sdb2 60GB. If sdb1 is using all the space, you can't create an sdb2 on that disk.
You never said what pvs showed. And while you're there, what does lvmdiskscan show? It's only for information, nothing else.
I would suggest, if you know that sdb1 is not being used, you remove it and repartition the disk with the sizes you want.
Over that, I would recommend this:
Remove "sdb1" using "fdisk" - actually I would remove the PV and rescan
Create a volume group called "oraclevg", or whatever it's for, using both sdb, and another for sdc - i.e. let LVM handle it.
Create logical volumes for u02 as 60 GB as whatever is left (100%FREE) from sdb
No help, just amusing. The "dumb message of the day" award goes to fdisk
Command (m for help): t
Partition number (1-5): 5
Partition 5 does not exist yet!
Command (m for help): t
Partition number (1-5): 4
Hex code (type L to list codes): 8e
You cannot change a partition into an extended one or vice versa
Delete it first.
I'm not experiencing the problems you are with pvcreate. Can you remove the PV and rescan it and start from scratch? (unless, of course, someone has a better idea, or, of course, sdb1 is actually being used!).
... I tried creating an extended partition to see if that caused a problem, then got that silly 'error'. It's of no consequence to your issue, just amusing.
Regarding the pvcreate error: do you know if your lvm.conf has been manually modified? If you do any multipathing chances are that it has been (otherwise you'd constantly be getting duplicate PV errors in /var/log/messages). You may check /etc/lvm/lvm.conf and see if you have a filter set up.
I think I messed up by deleting the physical volumes.
I was getting errors
# vgscan -v
Wiping cache of LVM-capable devices
Wiping internal VG cache
Reading all physical volumes. This may take a while...
Finding all volume groups
Finding volume group "VolGroup00"
Couldn't find device with uuid 'UPkdKc-Ki6u-5GUf-BY8u-WABy-ssZ6-lkPjJl'.
Couldn't find device with uuid 'bJaD2H-hx8h-dmD5-AgAk-RvHD-utl0-Gc9ooK'.
Couldn't find device with uuid 'eh2fqQ-RjQZ-eLOc-jVnL-oSd3-j8o2-JBEQny'.
There are 3 physical volumes missing.
Found volume group "VolGroup00" using metadata type lvm2
So removed these devices using: vgreduce --removemissing
And doing a reconfigure.
Now if I need to start and have 2 Logical Volumes on /sdb
thats /dev/sdb1 and /dev/sdb2. What steps are needed.
fdisk /dev/sdb
pvcreate /dev/sdb1
pvcreate /dev/sdb2 --- not sure if we need this
vgextend VolGroup00 /dev/sdb1
vgextend VolGroup00 /dev/sdb2
lvcreate -L 60G -n LogVolU02 VolGroup00
lvcreate -l 100%FREE -n LogVolU01 VolGroup00
But I still don't see the point of both partitioning with fdisk and then again with logical volumes. You'd be as well just using fdisk to specify ext3, or whichever FS type you want, then creating a filesystem without LVM, since it would be just as easy to create three primary fdisk partitions for your filesystems, or easier, actually, than creating two and then using LVM to carve it up further. And given that sdb1 and sdb2 are on the same physical disk - and I noticed that sdc seems to have been quietly dropped(!), you're not really gaining anything in terms of performance or reliability with the hybrid fdisk / LVM approach.
sdc I dropped as it is a different disk and will be an entirely used for sdc1.
I am not sure how to partition /sdb into 2
If it can be done without fdisk. Can you please guide as to what steps are needed. THe reason I have been using fdisk in beginning is I saw it online.
In the article, he is using fdisk to partition the disk to use partition type "8e" - Linux LVM.
If you allocate all space on sdb to a single primary partition (like you had before), you can then use LVM to create your volume group, and lvcreate to create the sizes of logical volumes you need.
I've never used fdisk to do this. Normally, just presenting the disk to the system and using LVM commands to create PV's, VG's and LV's is enough.
No need to fdisk. No need for fancy partitioning. I can now create my filesystems using these three LV's and I don't have to worry about it.
If, later on, I want to extend these filesystems, I can add a new disk, extend the VG, extend the LV, then easily extend the FS. It's hard to do that if you have partitioned everything, absolutely, with fdisk (although I suppose you could still extend the VGs with new disks, despite the strange fdisk partitioning).