Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

here's my brain teaser:

Got myself a server connected to a SAN. We would like to install Netbackup on it (to back up this and one other server). I would like to create a new partition within an LVM, about 10-15gb, on the local disk only. However, the Volume Group for the space allocated on the SAN is the same group name as what's allocated on the local disk.

How can I determine my available space on the local disk only, within the logical volume? I’d like to avoid using the SAN space as it may cause performance and/or other issues we don’t want. LVDISPLAY shows all LV stats, and VGS shows available space for the entire volume group. The physical volume itself has no available space to create a new partition or LV.

Thank you in advance!

Joel

share|improve this question
1  
I find your question confusing, either you're using terminology I'm not familiar with or you have an unusual setup. Could you post the output of pvs, vgs and lvs? –  Gilles Mar 29 '11 at 23:27

5 Answers 5

up vote 1 down vote accepted

I would like to create a new partition within an LVM, about 10-15gb, on the local disk only

That's very easy: lvcreate blah-blah-blah VolGroupName /dev/physical_to_use

share|improve this answer
    
Bing-bing!! [slaps forehead] should have known that. Located the physical device associated to the PV where I wanted the LV, and we're off and running. THANKS to everyone for their thoughts - got me moving again after hitting this bump in the path. –  Jman-49 Mar 31 '11 at 17:13

I think pvdisplay tells you free PEs on that physical volume. I assume that means PEs not allocated to logical volumes.

share|improve this answer
    
The physical volume itself has no available space to create a new partition or LV, as far as I could tell... I tried to create a new vg and could not. for posterity I'll double-check my notes. Thanks. –  Jman-49 Mar 29 '11 at 21:36
    
Thanks Bittrance - you and Gilles have me thinking and moving forward again. I'll look again at this situation with fresh eyes tomorrow. I'd vote you up if I had enough points to do so. Much appreciated. –  Jman-49 Mar 30 '11 at 0:30
    
Presumably there is free space in the SAN PVs. I think my first step would be to split the vg into two separate groups using pvmove to migrate the relevant data to SAN. Mind you, pvmove ate my data once, so backups, backups, backups. –  Bittrance Mar 30 '11 at 8:03
    
Ah a challenge I forgot about: We're using ASM to hold a bunch of oracle data in the SAN partitions. I suspect we have to watch for that, but I'll involve my DBA before I go that direction. I think we'll install NB, backup and help the next sysadmin clean up a bit. –  Jman-49 Mar 31 '11 at 3:17

However, the Volume Group for the space allocated on the SAN is the same group name as what's allocated on the local disk.

Do you mean you have two volume groups with the same name? If so, you can use UUIDs to distinguish between them (vgdisplay will show the UUIDs). To avoid confusion, your first step should be renaming one of the volumes:

vgrename abcdef-ghij-klmn-opqr-stuv-wxyz-012345 local_foo

Edit: From your comment, I wonder if you mean you have a single volume group that spans both the local disk and the SAN. If that's the problem, run vgsplit to split it into two volume groups:

vgsplit existing_group local_group /dev/sda1 /dev/sdb1
share|improve this answer
    
Nope, sorry for any confusion. What appears to be is the LVM spans local and SAN-based disk. We had a filesystem that initially was all local, and then installed the san for expansion/failover. Why the sysadmin doing this did not create a separate lvm for the san is beyond me. However I will double-check the UUID's. –  Jman-49 Mar 30 '11 at 0:27
    
Per your edit: Correct, I believe I have a single VG spanning the disk sets (local and SAN). Splitting the VG will be someone else's job, as I'm leaving this job and just trying to close this task out. We'll get the backup installed, roll to tape, and then have the safety net to "git'er done". –  Jman-49 Mar 31 '11 at 3:15
    
Thank you Gilles - I realized I was wrong about available space on the Physical Volume - PVS showed there was 18gb left. Created partition using poige's command line and I've created the LV. Uploading the install files now to get this work done. –  Jman-49 Mar 31 '11 at 17:16

pvs(8) shows the space usage of each physical volume.

pvmove(8) can be used to move physical extents within a logical volume between different physical volumes.

If you hadn't already begun, it could have been a good idea to keep local and SAN disks in different volume groups.

share|improve this answer

Thank you gentlemen!

@Bittrance, @Gilles, got me moving again, looking at the problem differently, and @Poige gave me the final big link I was missing. I ended up using the command LVM .... /dev/sda1 to create the partition within the existing local-disk PV. Turned out there was 18gb free space, of which I used 15.

With respect to MattBianco, I am leaving this job so I will turn the VG naming issue over to another (vastly more experienced) sysadmin to rename the second VG under controlled circumstances (in case applications depending on it blow up - you never know around here). By then he'll have reliable backup to depend on. If I were sticking around I might have tackled it or assisted him. I have no idea why the sysadmin creating this filesystem did what he did. One of the reasons I'm glad he's not there any longer...

See y'all from my new job. Thanks lots!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.