menuimage

Description

Options

Example

Exit_Codes

Dependencies

License

Changelog

Download

Donation

My_Other_Sites

My_Programs

Comments

lvm-delete-snapshot v3.6 [17 Nov 2021] by Dominic

Description

GNU/Linux script for a machine where LVM (Logical Volume Management) is used. It removes/deletes an LVM snapshot, and can be called by another process or used when a snapshot has been unintentionally left over by another process. It tries various escalating steps to remove the snapshot; in rare cases the removal might not be completed until after a reboot and then a rerun of lvm-delete-snapshot.sh.

For safety reasons, lvm-delete-snapshot.sh will refuse to remove the specified object if it is not an LVM snapshot.

It also removes the mountpoint for the snapshot, if one exists.

You can find the name of your snapshot with the command 'sudo lvs'.

Tested under LVM 2.02.176(2), 2.02.133(2), 2.02.98(2), 2.02.95(2), 2.02.66(2).

Options

-f - don't ask before proceeding - use with care!
-h - show help and exit

Example

sudo ./lvm-delete-snapshot.sh homebackup

Exit Codes

0 indicates success or no action was required (e.g. no such snapshot exists)
1 indicates a problem occurred

Dependencies

awk, basename, bash, fold, grep, lvm, stty, umount

License

Copyright © 2021 Dominic Raferd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Changelog

3.6 [17 Nov 2021] enable changelog, revise for better compliance with shellcheck, remove support for older LVM versions
3.5 [04 Mar 2021] a couple of bugfixes
3.4 [04 Mar 2019] updated version testing information in help
3.3 [22 Jul 2016] updated code to identify snapshots, add debug mode, add changelog
3.2 [02 Sep 2015] previous version

Download lvm-delete-snapshot.sh

Donation

I have provided this software free gratis and for nothing. If you would like to thank me with a contribution, please let me know and I will send you a link. Thank you!

My Other Sites

My Programs

Here is a selection of some (other) programs I have written, most of which run under GNU/Linux from the command line (CLI), are freely available and can be obtained by clicking on the links. Dependencies are shown and while in most cases written and tested on an x86-based Linux server, they should run on a Raspberry Pi, and many can run under Windows using Windows Subsystem for Linux (WSL) or Cygwin. Email me if you have problems or questions, or if you think I could help with a programming requirement.

Backup Utilities

Debian/Ubuntu kernel and LVM Utilities

Miscellaneous Programs

Comments

This section is closed. If you have a question, please submit it by email, thank you.

No comments yet for '/programs/help/lvm-delete-snapshot.sh.php'