vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| yes you can. Of course its always a good idea to have a backup. check 1vreduce (1m) in man. "yls177" <yls177@hotmail.com> wrote in message news:c06e4d68.0407102036.d4d6603@posting.google.co m... > is it possible to reduce the size of the logical volume without the > risk of losing data? > > in sam, there are no reduce option. |
| |||
| "LetsFindaDeal" <ccc@caraudio.com> wrote in message news:<NRhIc.867486$Ar.862429@twister01.bloor.is.ne t.cable.rogers.com>... > yes you can. Of course its always a good idea to have a backup. check > 1vreduce (1m) in man. > > "yls177" <yls177@hotmail.com> wrote in message > news:c06e4d68.0407102036.d4d6603@posting.google.co m... > > is it possible to reduce the size of the logical volume without the > > risk of losing data? > > > > in sam, there are no reduce option. i cant do it in sam? |
| |||
| yls177@hotmail.com wrote: >"LetsFindaDeal" <ccc@caraudio.com> wrote in message >news:<NRhIc.867486$Ar.862429@twister01.bloor.is.n et.cable.rogers.com>... >> yes you can. Of course its always a good idea to have a backup. check >> 1vreduce (1m) in man. >> >> "yls177" <yls177@hotmail.com> wrote in message >> news:c06e4d68.0407102036.d4d6603@posting.google.co m... >> > is it possible to reduce the size of the logical volume without the >> > risk of losing data? >> > >> > in sam, there are no reduce option. > >i cant do it in sam? A logical volume is a container. If you lop it off to a smaller size without first reducing what it contains, then you risk losing/corrupting the contents eg a filesystem. |
| |||
| In article <c06e4d68.0407102036.d4d6603@posting.google.com> , yls177 wrote: > is it possible to reduce the size of the logical volume without the > risk of losing data? > > in sam, there are no reduce option. Some of the answers, although accurate as far as they go, aren't complete. The first thing you have to do is identify which filesystem you're using. Chances are you're using vxvs. Verify that by grep'ing the filesystem from /etc/fstab: # grep data1 /etc/fstab # /data1 /dev/vg01/lvol2 /data1 vxfs rw,suid,largefiles,delaylog,datainlog 0 2 Please put your target filesystem in there. Note the third field says vxfs. The other possibility is hfs: # grep stand /etc/fstab /dev/vg00/lvol1 /stand hfs defaults 0 1 If you're running hfs, the only way to reduce the lv is as follows: 1. Back up all data on the target lv 2. lvreduce -L ${new_size_in megs} ${lv} 3. newfs -F hfs ${r_lv} 4. Restore the data. If you're running vxfs, then you have to ID whether or not you have the online jfs package installed: # swlist | grep -i online B3929BA B.11.00 HP OnLineJFS (Advanced VxFS) If you don't have it, then you're back to the procedure above. If you have it, then the procedure is as follows: 1. Back up all data on the target lv 2. Defragment the mount point: fsadm -d ${mount_point}; fsadm -e ${mount_point} 3. Reduce the filesystem: fsadm -b ${new_size_in_K} ${mount_point} 4. Reduce the logical volume: lvreduce -L ${new_size_in megs} ${lv} The big benefit of the online jfs is that, in theory, all of that can be done while the system is hot. Obviously, if people are hammering the thing while you're reducing the filesystem, it's going to take quite a bit longer so make sure the system is as quiet as possible. In either case MAKE SURE YOU HAVE A COMPLETE BACKUP!!! HTH; Doug the data, lvreduce the lv, -- -------- Senior UNIX Admin O'Leary Computer Enterprises dkoleary@olearycomputers.com (w) 630-904-6098 (c) 630-248-2749 resume: http://www.olearycomputers.com/resume.html |
| |||
| Doug O'Leary <dkoleary@olearycomputers.com> wrote in message news:<IVxIc.3090$696.1207@fe07.usenetserver.com>.. . > In article <c06e4d68.0407102036.d4d6603@posting.google.com> , yls177 wrote: > > is it possible to reduce the size of the logical volume without the > > risk of losing data? > > > > in sam, there are no reduce option. > > Some of the answers, although accurate as far as they go, aren't complete. > > The first thing you have to do is identify which filesystem you're using. > Chances are you're using vxvs. Verify that by grep'ing the filesystem > from /etc/fstab: > > # grep data1 /etc/fstab > # /data1 > /dev/vg01/lvol2 /data1 vxfs rw,suid,largefiles,delaylog,datainlog 0 2 > > Please put your target filesystem in there. Note the third field > says vxfs. The other possibility is hfs: > > # grep stand /etc/fstab > /dev/vg00/lvol1 /stand hfs defaults 0 1 > > If you're running hfs, the only way to reduce the lv is as follows: > > 1. Back up all data on the target lv > 2. lvreduce -L ${new_size_in megs} ${lv} > 3. newfs -F hfs ${r_lv} > 4. Restore the data. > > If you're running vxfs, then you have to ID whether or not you have the > online jfs package installed: > > # swlist | grep -i online > B3929BA B.11.00 HP OnLineJFS (Advanced VxFS) > > If you don't have it, then you're back to the procedure above. If you have > it, then the procedure is as follows: > > 1. Back up all data on the target lv > 2. Defragment the mount point: > fsadm -d ${mount_point}; fsadm -e ${mount_point} > 3. Reduce the filesystem: fsadm -b ${new_size_in_K} ${mount_point} > 4. Reduce the logical volume: lvreduce -L ${new_size_in megs} ${lv} > > The big benefit of the online jfs is that, in theory, all of that can > be done while the system is hot. Obviously, if people are hammering the > thing while you're reducing the filesystem, it's going to take quite a bit > longer so make sure the system is as quiet as possible. > > In either case MAKE SURE YOU HAVE A COMPLETE BACKUP!!! > > HTH; > > Doug > > the data, lvreduce the lv, thanks, i am on vxfs and have online JFS too. cheers.. basically, my understanding is that we need to make sure that the space in the filesystem is contiguous (defragment), after which, we will delete data and has to confirm that the remaining data has enough space for the reduced logical volume. what do u think? |
| |||
| In article <c06e4d68.0407121712.63992772@posting.google.com >, yls177 wrote: > > thanks, i am on vxfs and have online JFS too. cheers.. > > basically, my understanding is that we need to make sure that the > space in the filesystem is contiguous (defragment), after which, we > will delete data and has to confirm that the remaining data has enough > space for the reduced logical volume. > I think you have it. Just to rephrase/paraphrase - what you're doing is defragmenting the filesystem so all the data is at one end of it. You can then use du -sk to verify how much data is on that mount point. Once you have that, you know the minimum size the lv has to be to hold all the data. If you're going to delete data, do it before the defragmentation - because you'll have to defragment again after deleting data anyway. Doug -- -------- Senior UNIX Admin O'Leary Computer Enterprises dkoleary@olearycomputers.com (w) 630-904-6098 (c) 630-248-2749 resume: http://www.olearycomputers.com/resume.html |
| |||
| Another option is OnlineJFS. "ECStahl" <ecstahl@aol.com> wrote in message news:20040712034705.05605.00001275@mb-m14.aol.com... > yls177@hotmail.com wrote: > >>"LetsFindaDeal" <ccc@caraudio.com> wrote in message >>news:<NRhIc.867486$Ar.862429@twister01.bloor.is. net.cable.rogers.com>... >>> yes you can. Of course its always a good idea to have a backup. check >>> 1vreduce (1m) in man. >>> >>> "yls177" <yls177@hotmail.com> wrote in message >>> news:c06e4d68.0407102036.d4d6603@posting.google.co m... >>> > is it possible to reduce the size of the logical volume without the >>> > risk of losing data? >>> > >>> > in sam, there are no reduce option. >> >>i cant do it in sam? > > A logical volume is a container. If you lop it off to a smaller size > without > first reducing what it contains, then you risk losing/corrupting the > contents > eg a filesystem. |
| ||||
| Doug O'Leary <dkoleary@linux.olearycomputers.com> wrote in message news:<IOHIc.7$nH.3@fe07.usenetserver.com>... > In article <c06e4d68.0407121712.63992772@posting.google.com >, yls177 wrote: > > > > thanks, i am on vxfs and have online JFS too. cheers.. > > > > basically, my understanding is that we need to make sure that the > > space in the filesystem is contiguous (defragment), after which, we > > will delete data and has to confirm that the remaining data has enough > > space for the reduced logical volume. > > > > I think you have it. Just to rephrase/paraphrase - what you're > doing is defragmenting the filesystem so all the data is at one > end of it. You can then use du -sk to verify how much data is > on that mount point. Once you have that, you know the minimum size > the lv has to be to hold all the data. > > If you're going to delete data, do it before the defragmentation - > because you'll have to defragment again after deleting data anyway. > > Doug absolutely.. thanks for the pointers, Doug much appreciated |