How to reduce the size of a logical volume in solaris 9


 
Thread Tools Search this Thread
Operating Systems Solaris How to reduce the size of a logical volume in solaris 9
# 1  
Old 10-26-2005
How to reduce the size of a logical volume in solaris 9

Hi,
I have the following problem.
I just have a new machine with mirroring. The logical volume for /opt is dimensionned to 75 GB which is to much. I want a volume of 10 GB. How can I reduce the size ?
I tried to reduce the size of the slice from 75 GB to 10 GB, but the size of the logical volume does not decrease.
I tried to delete the logical volume and its submirrors to create them again with the right size, but I can delete only one submirror and not the second one.
Is there a way to do this ?
Thanks for your help.
Alain
# 2  
Old 10-26-2005
What product are you using to administer the disks? What version of the software?
# 3  
Old 10-27-2005
The software is SDS (I suppose : the commands are metainit, metattach ...) and the OS is Solaris 9 9/05 on SPARC.
# 4  
Old 10-27-2005
well, there is no possibility to shrink UFS and as far as i know nothing to reduce the space of a metadevice
# 5  
Old 10-27-2005
Thanks. That's what I guessed too.
What I did is the following :
unmount the file system ;
clear the mirroring with metadetach and metaclear ;
reduce the size of the initial slices from 75 GB to 15 GB ;
create new volumes on these slices ;
create the mirror with these volumes ;
mount the file system again.
It seems that it is working : the command metastat gives me a correct result. The only thing wrong is that the command df continues to see a volume of 75 GB !! I don't know why.
Is there something wrong ?
# 6  
Old 10-27-2005
well, as i said, it is not possible to shrink an UFS... what you did, you reduced the volume and not the filesystem. UFS still thinks that there are 75G (with all blocks) and you will come in troubles when UFS wants to create a file behind the last actual block.... it is created at the time of file-system creation, all things are stored in your inode table... you cannot rebuild a inode table...

what you could do:
destroy your mirror and mount the single partition. mount the second partition on another mountpoint:
Code:
metaclear -r d100 << the mirror
#now create the smaller partition on the second disk with format;
metainit d10 1 1 c0t0d0s6 << the old big one
metainit d20 1 1 c0t1d0s6 << the smaller new one
mount /dev/md/dsk/d10 /mnt1
newfs /dev/md/rdsk/d20
mount /dev/md/dsk/d20 /mnt2
ufsdump 0f - /dev/md/rdsk/d10 | (cd /mnt2;ufsrestore xf -)
umount /mnt1
umount /mnt2
#destroy the old big one
metaclear d10
#now create a new mirror with the small partition and let the small one act as
#the primary for the mirror
metainit d100 -m d20
mount /dev/md/dsk/d100 /opt
#let's look the first disk like the 2nd one, only if there are no other different slices:
prtvtoc /dev/rdsk/c0t1d0s2 | fmthard -s - /dev/rdsk/c0t0d0s2
#reattach the old, now also a small one
metattach d100 d10

this should work, but be careful with fmthard, do this only if you have exactly the same disks and partitions

greetings PRESSY
# 7  
Old 10-28-2005
MySQL

Thanks a lot !
Your solution works perfectly. I have applied it this morning and all is perfect.
I have understood a lot of things with post.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Shrink ext4 filesystem and reduce the size of a Logical Volume in Linux

Hello guys, I would like to ask you kindly if you don't know some quick and safe method how to shrink ext4 filesystem and reduce the size of a Logical Volume in Linux, please? Thank you very much. (2 Replies)
Discussion started by: los_bandidos
2 Replies

2. Red Hat

No space in volume group. How to create a file system using existing logical volume

Hello Guys, I want to create a file system dedicated for an application installation. But there is no space in volume group to create a new logical volume. There is enough space in other logical volume which is being mounted on /var. I know we can use that logical volume and create a virtual... (2 Replies)
Discussion started by: vamshigvk475
2 Replies

3. AIX

Position of the logical volume on the physical volume

Hello everyone, I just read that while creating a logical volume(LV) we can choose the region of the physical volume (PV) in which the LV should be created. When I say region I mean: outer edge - outer middle - center - inner middle and inner edge. Can anyone help me understand the utility... (11 Replies)
Discussion started by: adilyos
11 Replies

4. UNIX for Dummies Questions & Answers

Confusion Regarding Physical Volume,Volume Group,Logical Volume,Physical partition

Hi, I am new to unix. I am working on Red Hat Linux and side by side on AIX also. After reading the concepts of Storage, I am now really confused regarding the terminologies 1)Physical Volume 2)Volume Group 3)Logical Volume 4)Physical Partition Please help me to understand these concepts. (6 Replies)
Discussion started by: kashifsd17
6 Replies

5. UNIX for Dummies Questions & Answers

Unable to reduce the size of volume group?

My volume group of size 200 gb. out of which only 100 gb is used by 2 logical volumes /dev/vg00/lvol0 and /dev/vg00/lvol0 respectively (both are 50 gb each). Whenever i use vgreduce command to reduce the size of volume group i get below error. # vgreduce vg00 -a Physical volume... (16 Replies)
Discussion started by: pinga123
16 Replies

6. HP-UX

Unable To Extend the Size of a Logical Volume File System

Background: # uname -a HP-UX deedee B.11.23 U ia64 4294967295 unlimited-user license deedee.rsn.hp.com:/ # bdf /opt Filesystem kbytes used avail %used Mounted on /dev/vg00/lvol6 6553600 6394216 158144 98% /opt /opt is almost full... (3 Replies)
Discussion started by: Rob Sandifer
3 Replies

7. AIX

Logical volume name conflict in two volume group

Hello, I am a french computer technician, and i speak English just a little. On Aix 5.3, I encounter a name conflict logical volume on two volume group. The first volume lvnode01 is OK in rootvg and mounted. It is also consistent in the ODM root # lsvg -l rootvg |grep lvnode01 ... (10 Replies)
Discussion started by: dantares
10 Replies

8. AIX

Basic Filesystem / Physical Volume / Logical Volume Check

Hi! Can anyone help me on how I can do a basic check on the Unix filesystems / physical volumes and logical volumes? What items should I check, like where do I look at in smit? Or are there commands that I should execute? I need to do this as I was informed by IBM that there seems to be... (1 Reply)
Discussion started by: chipahoys
1 Replies

9. AIX

Moving a Logical Volume from one Volume Group to Another

Does anyone have any simple methods for moving a current logical volume from one volume group to another? I do not wish to move the data from one physical volume to another. Basically, I want to "relink" the logical volume to exist in a different volume group. Any ideas? (2 Replies)
Discussion started by: krisw
2 Replies

10. UNIX for Advanced & Expert Users

LVM - Extending Logical Volume within Volume Group

Hello, I have logical volume group of 50GB, in which I have 2 logical volumes, LogVol01 and LogVol02, both are of 10GB. If I extend LogVol01 further by 10GB, then it keeps the extended copy after logical volume 2. I want to know where it keeps this information Regards Himanshu (3 Replies)
Discussion started by: ghimanshu
3 Replies
Login or Register to Ask a Question