Hello,
you need to be able to create LVM snapshot manually, I tested it for you on
one our server (SUSE11):
srv-db01:~ # lvcreate -L1G --snapshot -n
LVbackup /dev/mapper/vg00-lv_opt_tivoli_cit
Logical volume "LVbackup" created
srv-db01:~ # lvdisplay
.....
--- Logical volume ---
LV Name /dev/vg00/LVbackup
VG Name vg00
LV UUID LcG3Lu-rq0z-GR36-ozaq-crcP-Ye9x-v2jrqZ
LV Write Access read/write
LV Creation host, time tep500-db01, 2016-11-28 14:34:01 +0100
LV snapshot status active destination for /dev/vg00/lv_opt_tivoli_cit
LV Status available
# open 0
LV Size 1.00 GiB
Current LE 256
COW-table size 1.00 GiB
COW-table LE 256
Allocated to snapshot 0.00%
Snapshot chunk size 4.00 KiB
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 1024
Block device 253:70
...
srv-db01:~ # mkdir /LVbackup
srv-db01:~ # mount /dev/vg00/LVbackup /LVbackup
srv-db01:~ # df -h /LVbackup
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg00-LVbackup 1008M 62M 895M 7% /LVbackup
srv-db01:~ # ls /LVbackup
bin cache_data CIT_files config install lost+found properties
srv-db01:~ # umount /LVbackup
srv-db01:~ # lvremove /dev/vg00/LVbackup
Do you really want to remove active logical volume LVbackup? [y/n]: y
Logical volume "LVbackup" successfully removed
Your error states that you don't have enough free space in volume group
'mongo_byg_pribuild'.
Did you create logical volume db_snap manualy? Was it created by dsmc's
invocation and not cleaned afterwards?
You should be able to use lvextend/lvreduce commands to change size of
snapshot LV as per manual pages of lvcreate (man lvcreate):
-s, --snapshot OriginalLogicalVolume{Name|Path}
The snapshot with the specified size does not need the same amount of
storage the origin has. In a typical scenario, 15-20% might be enough. In
case the snapshot runs out of storage, use lvextend(8) to grow it.
Shrinking a snapshot is supported by lvreduce(8) as well.
Bye
Martin J.
"ADSM: Dist Stor Manager" <[email protected]> wrote on 11/28/2016
01:42:08 PM:
> From: Bo Nielsen <[email protected]>
> To: [email protected]
> Date: 11/28/2016 01:43 PM
> Subject: Re: [ADSM-L] LVM Snapshot failed..
> Sent by: "ADSM: Dist Stor Manager" <[email protected]>
>
> Hi Martin,
>
> Can you tell me how I extend the LVG. I have tried, but it's not right.
>
> DF cmd:
> /dev/mapper/mongo_byg_pribuild-mongo 2113638320 399284 2016587488
> 1% /mnt/mongo
> /dev/mapper/mongo_byg_pribuild-db_snap 2113638320 81944 2006166220
> 1% /mnt/mongo_db_snap
>
> From LVDISPLAY:
> --- Logical volume ---
> LV Path /dev/mongo_byg_pribuild/mongo
> LV Name mongo
> VG Name mongo_byg_pribuild
> LV UUID IiRkjV-qGSf-TBIq-989F-zGIK-iHt4-jzSZsd
> LV Write Access read/write
> LV Creation host, time byg-pribuild, 2016-11-02 15:15:33 +0100
> LV snapshot status source of
> db_snap [active]
> LV Status available
> # open 1
> LV Size 2.00 TiB
> Current LE 524286
> Segments 2
> Allocation inherit
> Read ahead sectors auto
> - currently set to 8192
> Block device 253:2
>
> --- Logical volume ---
> LV Path /dev/mongo_byg_pribuild/db_snap
> LV Name db_snap
> VG Name mongo_byg_pribuild
> LV UUID fYGMil-2p3q-i33u-tdPV-gghC-pOFT-xNUR3Q
> LV Write Access read/write
> LV Creation host, time byg-pribuild, 2016-11-28 12:51:22 +0100
> LV snapshot status active destination for mongo
> LV Status available
> # open 1
> LV Size 2.00 TiB
> Current LE 524286
> COW-table size 2.00 TiB
> COW-table LE 524287
> Allocated to snapshot 1.58%
> Snapshot chunk size 4.00 KiB
> Segments 1
> Allocation inherit
> Read ahead sectors auto
> - currently set to 8192
> Block device 253:5
>
> I'm not strong in Linux. So pls help or guide me in the right way.
> Thanks
>
> Bo Nielsen
>
> -----Original Message-----
> From: ADSM: Dist Stor Manager [mailto:[email protected]] On
> Behalf Of Martin Janosik
> Sent: 15. november 2016 12:38
> To: [email protected]
> Subject: Re: [ADSM-L] LVM Snapshot failed..
>
> Hi,
> check amount of free space in volume group mongo_byg_pribuild. Free
> space in volume group is used to create snapshot of existing logical
volume.
> Test if you can create snapshot manually (using linux commmands)
> before investigating - some instructions can be found on http://
> www.tldp.org/HOWTO/LVM-HOWTO/snapshots_backup.html
> Bye
>
> M. Janosik
>
> "ADSM: Dist Stor Manager" <[email protected]> wrote on 11/15/2016
> 11:43:58 AM:
>
> > From: Bo Nielsen <[email protected]>
> > To: [email protected]
> > Date: 11/15/2016 11:46 AM
> > Subject: [ADSM-L] LVM Snapshot failed..
> > Sent by: "ADSM: Dist Stor Manager" <[email protected]>
> >
> > I'm not expert in Linux. I try to do a LVM snapshot on Linux (CentOS
> > Linux release 7.2.1511).
> >
> > I get this error:
> >
> > 1/15/2016 11:12:16 ANS5250E An unexpected error was encountered.
> > TSM function name : DSnapshotProvider::startSnapshot():
> > TSM function : File descriptor 3 (/opt/tivoli/tsm/client/ba/
> > bin/dsmopt.lock) leaked on lvcreate invocation. Parent PID 31371:
> > /bin/sh File descriptor 7 (/opt/tivoli/tsm/client/ba/bin/dsmopt.lock)
> > leaked on lvcreate invocation. Parent PID 31371: /bin/sh File
> > descriptor 9 (/opt/tivoli/tsm/client/ba/bin/dsmopt.lock) leaked on
> > lvcreate invocation. Parent PID 31371: /bin/sh
> > Volume group "mongo_byg_pribuild" has insufficient free space (0
> > extents): 26215 required.
> >
> > TSM return code : 5
> > TSM file : DSnapshotProvider.cpp (648)
> > 11/15/2016 11:12:16 ANS1259E The image snapshot operation failed.
> > Diagnostic text: tsmStartSnapshot.
> > 11/15/2016 11:12:16 ANS8103W A command was not successful.
> > command : /sbin/lvremove -f /dev/mongo_byg_pribuild/
> > tsmsnapshot_date_11_15_2016_time_11.12.16 1>/dev/null
> > TSM function name : DSnapshotProvider::deleteSnapshot():
> > error output : File descriptor 3 (/opt/tivoli/tsm/client/ba/
> > bin/dsmopt.lock) leaked on lvremove invocation. Parent PID 31374:
> > /bin/sh File descriptor 7 (/opt/tivoli/tsm/client/ba/bin/dsmopt.lock)
> > leaked on lvremove invocation. Parent PID 31374: /bin/sh File
> > descriptor 9 (/opt/tivoli/tsm/client/ba/bin/dsmopt.lock) leaked on
> > lvremove invocation. Parent PID 31374: /bin/sh
> > Failed to find logical volume "mongo_byg_pribuild/
> > tsmsnapshot_date_11_15_2016_time_11.12.16"
> >
> > return code : 5
> > TSM file : DSnapshotProvider.cpp (840)
> > 11/15/2016 11:12:17 ANS1228E Sending of object '/mnt/mongo' failed.
> > 11/15/2016 11:12:17 ANS1258E The image snapshot operation failed.
> >
> > 11/15/2016 11:12:17 ANS1813E Image Backup processing of '/mnt/mongo'
> > finished with failures.
> >
> > TSM client vers.: 7.1.4.0
> >
> > Used command:
> > dsmc backup image /mnt/mongo -snapshotproviderimage=LINUX_LVM -
> > SNAPSHOTCACHESIZE=10
> >
> > lvdisplay:
> >
> > --- Logical volume ---
> > LV Path /dev/mongo_byg_pribuild/mongo
> > LV Name mongo
> > VG Name mongo_byg_pribuild
> > LV UUID IiRkjV-qGSf-TBIq-989F-zGIK-iHt4-jzSZsd
> > LV Write Access read/write
> > LV Creation host, time byg-pribuild, 2016-11-02 15:15:33 +0100
> > LV Status available
> > # open 1
> > LV Size 1024.00 GiB
> > Current LE 262143
> > Segments 1
> > Allocation inherit
> > Read ahead sectors auto
> > - currently set to 8192
> > Block device 253:2
> >
> > /dev/mapper/mongo_byg_pribuild-mongo 1008G 366M 957G 1% /mnt/mongo
> >
> > What do I missed or is it impossible ???
> > We expect the DB is growth to 2 Tb, therefor the snapshot technology.
> >
> > Regards
> >
> > Bo Nielsen
> >
> >
> > IT Service
> >
> >
> >
> > Technical University of Denmark
> >
> > IT Service
> >
> > Frederiksborgvej 399
> >
> > Building 109
> >
> > DK - 4000 Roskilde
> >
> > Denmark
> >
> > Mobil +45 2337 0271
> >
> > [email protected]<mailto:[email protected]>
> >
>