- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- lvextend options
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 12:30 PM
10-03-2002 12:30 PM
The line with "lvextend -l 1 /dev/dsk/cXtXdX" is the one I have a question about.
I have this procedure that I got from a co-worker for adding disks to a VG and I need some advice about a certain line. It appears that it is only adding 1 LE to it.
umount /tmp
lvremove /dev/vg01/tmp
lvcreate -n tmp /dev/vg01
####
lvextend -l 1 /dev/vg01/tmp /dev/dsk/c3t3d0 #### Is this a good line???
lvextend -m 1 /dev/vg01/tmp /dev/dsk/c4t3d0
lvextend -L 8000 /dev/vg01/tmp /dev/dsk/c3t3d0 /dev/dsk/c4t3d0
newfs -F vxfs /dev/vg01/rtmp
mount /tmp
It appears that they are doing this to begin the process of mirroring, but it looks like it is doing the same thing 2 commands later when it lvextends -L 8000.
I think I could just get rid of that command and move up the one from 2 lines below and then do the miror command.
please help me clarify this.
Solved! Go to Solution.
- Tags:
- lvextend
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 12:35 PM
10-03-2002 12:35 PM
Re: lvextend options
and then do the mirror.
lvextend -m 1 /dev/vg01/tmp /dev/dsk/c4t3d0
I like the fact that you are mirroring on separate SCSI buses.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 12:39 PM
10-03-2002 12:39 PM
Re: lvextend options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 12:39 PM
10-03-2002 12:39 PM
SolutionI normally do it this way,
# lvcreate -n lv_name /dev/vg_name
# lvextend -L size_MB /dev/vg_name/lv_name /dev/dsk/first_pv
# lvextend -m 1 /dev/vg_name/lv_name /dev/dsk/second_pv
You can use more options with lvcreate command to suit your specific requirements. See "man lvcreate" for more help on lvcreate command.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 12:40 PM
10-03-2002 12:40 PM
Re: lvextend options
lvcreate -L 8000 -m 1 -s y -n tmp /dev/vg01
This will work if /dev/dsk/c3t3d0 and /dev/dsk/c4t3d0
The '-s y' option will tell lvcreate that the primary and mirror extents can NOT occupy the same physical disk.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 12:42 PM
10-03-2002 12:42 PM
Re: lvextend options
think you may need a new approach. If you are adding these disks solely to support /tmp... then I think you should just create a new volume group and not extend vg01. Try this:
1. pvcreate /dev/rdsk/cxtxdx (the new disks)
2. mkdir /dev/vg02 (or whatever is next in sequence)
3. cd /dev/vg02
4. mknod group c 64 0x02000 (the 2 needs to be unique, but making it match the vg number usually covers this)
5. vgcreate /dev/vg02 /dev/dsk/cxtxdx /dev/dsk/cxtxdx (use the 2 disks you just created)
6. lvcreate -L 8000 -n tmp /dev/vg02
7. newfs -F vxfs /dev/vg02/rtmp
** now you need to decide if you want any files in the current /tmp... if you do, save them somewhere with a tar (tar -cvf /var/xxx.tar /tmp)
You may also have trouble getting /tmp unmounted if the system is busy... at any rate
8. umount /tmp
9. Edit the /etc/fstab file (after saving a copy somewhere) and create a line for the new /tmp and remove the old one.
10. mount -a will mount the new /tmp and also verify that the /etc/fstab is clean
11. bdf... should see a nice fat 8 GB /tmp
12. Restore /tmp files if you wanted them from the tar (tar -xvf /var/xxx.tar)
13. perform a vgdisplay -v vg02 and see if all of the extents created are on one disk and note the one that has none on it (/dev/dsk/cxtxdx)
14. now mirror: lvextend -m 1 /dev/vg02/tmp /dev/dsk/cxtxdx
whew...
Ted
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 12:44 PM
10-03-2002 12:44 PM
Re: lvextend options
I agree with Clay.
Perhaps your co-worker was thinking (or adopted this code) from a situation where he/she wanted to 'lvcreate' a logical volume but target it to a specific physical volume of a volume group. In the ase of 'lvcreate' omitting the '-l' and '-L' options allows a logical volume to be created with zero length. In turn, this permits you to choose its physical volume location when you allocate logical extents with the 'lvextend'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 12:51 PM
10-03-2002 12:51 PM
Re: lvextend options
Here is some more explanation of my situation with this box.
First, my /tmp, /usr/tmp and /var/tmp are linked to the /tmp directory, becuase many of my Oracle processes are hardcoded to write to /var/tmp which was very small, considering that /var is only 1.6GB.
Second, the reason I need 8GB for tmp is that this box is a major webserver along with 3 other ones and my DBAs like to have a lot of space for temp files generated by the web browser as well as for Oracle. Potentially, I could have several hundred users online at the same time.
Thanks for the -s y option, I knew about that option which is a very good suggestion to make sure that it is strict.
thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 12:55 PM
10-03-2002 12:55 PM
Re: lvextend options
That will be much easier than what I was going to do, trying to lvextend it where it was. I have 3 other filesystems in vg01. It will make it easier to administer down the road.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 01:47 PM
10-03-2002 01:47 PM
Re: lvextend options
Here is my interpretation of the logic behind this procedure:
lvcreate -n tmp /dev/vg01
creates the new lvol with no size specified.
lvextend -l 1 /dev/vg01/tmp /dev/dsk/c3t3d0
extend the size of the lvol to be 1 extent on the specified PV.
lvextend -m 1 /dev/vg01/tmp /dev/dsk/c4t3d0
Create the mirror of the lvol on the specified PV. Since the previous lvextend command only made the size of the lvol 1 extent, which defaults to 4MB, the sync of the lvol that happens when you create the mirror will be very fast.
lvextend -L 8000 /dev/vg01/tmp /dev/dsk/c3t3d0 /dev/dsk/c4t3d0
Now, AFTER it is mirrored, extend it to the size you want.
newfs -F vxfs /dev/vg01/rtmp
create the new file system on the lvol.
If you had created the lvol as 8GB, then did the lvextend to mirror it, the process would take much longer to execute. Since you are creating this as a new lvol there is no reason to copy all 8GB of data between the two disks, especially when the next command is to do a newfs.
Just my $0.02
--
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2002 12:01 AM
10-04-2002 12:01 AM
Re: lvextend options
just like to add that Anthony absolutely hit it.
this procedure will speed up the process by HOURS if you need to set up lvm mirrored lvols with a total of hundred or more GB - especially on a D- or K-Class.
Regards,
Bernhard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2002 07:31 AM
10-04-2002 07:31 AM
Re: lvextend options
Also, Patrick's solution would provide the same results minus the capability of specifying explicitly which disks to use.
--
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2002 07:54 AM
10-04-2002 07:54 AM
Re: lvextend options
just perform the lvextend and fsadm commands listed below:
lvcreate -L 8000 -m 1 -s y -n tmp /dev/vg01
fsadm -F vxfs /dev/vg01/rtmp
Hope this helps
fg.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2003 12:19 AM
12-04-2003 12:19 AM
Re: lvextend options
A very late reply, but I think it is still valuable. The notes from your collegue are absolute correct.
The reason why he first created a volume containing 1 PE is because you want to mirror it.
If you first make an 80 Gb Volume and than start mirroring, the disk will resync the 80 Gb of "data". If you first create a 1 Pe (most of all 4 or 8 Mb) volume, you will sync only 8 Mb data a max when you start mirroring.
When you add 80 Gb now, your data does not need a resync, but just gets added in mirror format. This saves you lots of disk load and waiting time, before you can proceed to take next steps.
In short; adding a mirror needs resyncing your current volume data. If you keep your volume as small as possible it saves resync time.
Notice : Once you already have a mirrored volume, no resyncing is necesary when increasing the volume size.
Regs David