Operating System - HP-UX
1832541 Members
4628 Online
110043 Solutions
New Discussion

Re: reduce a raw logical volume

 
RK_7
Advisor

reduce a raw logical volume

Dear all,

Can I reduce a raw logical volume without loosing data.

Regards
4 REPLIES 4
Arunvijai_4
Honored Contributor

Re: reduce a raw logical volume

RK,

You can use # lvreduce

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
RAC_1
Honored Contributor

Re: reduce a raw logical volume

I do not know any fool-proof method for this.
I would do it in following way.

1 Back it up. (with backup softwares that can backup raw device)
2 Destroy and create with new size
3 Restore.

You can also do as follows.
Prepare temporary lvol.
copy the data to new lvol-dd
Remove and crreate new raw vol with require size and copy back with dd.
There is no substitute to HARDWORK
RK_7
Advisor

Re: reduce a raw logical volume

Hi RAC,

If I do a dd How can I change my lvol size?

Regards
Rajeev  Shukla
Honored Contributor

Re: reduce a raw logical volume

Is its a filesystem then you know how much you have used and you could reduce using lvreduce, but still a valid backup is required to be on safer side.
Now on a raw device, how do you know how much have you used? maybe you can tell if the raw device is used by say a database..but from system (OS) point of view you really dont know how much is used?
I therefore would go for a second method..
Backup the raw device, delete it and recreate of the required size.