Visit the LQ Articles and Editorials section
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


Search this Thread
Old 11-15-2009, 02:28 AM   #1
Registered: Apr 2004
Distribution: redhat 9.0, fc4, redhat as 4
Posts: 519

Rep: Reputation: 31
lvm snapshot using script


I am writing a script to create backup of data on LVM. when i try to put variable in place of size number it stops, and put error on console.

[root@swd data]# lvcreate --size $sumM --snapshot -n backup /dev/vg_swd/LogVol02
  Invalid argument --snapshot
  Error during parsing of command line.
whereas same command works without any error. 
[root@swd data]# lvcreate --size 510M --snapshot -n backup /dev/vg_swd/LogVol02
Old 11-15-2009, 08:24 AM   #2
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
The variable is $sum but the variable name given on the command is $sumM. Any of these will work
The forms in which $sum (or $sum}) are in double quotes are more a little more robust in case $sum does not contain the expected integer but a value including whitespace such as space.
Old 11-15-2009, 09:35 AM   #3
Registered: Apr 2004
Distribution: redhat 9.0, fc4, redhat as 4
Posts: 519

Original Poster
Rep: Reputation: 31
thanks, catkin. i will check this.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
linux lvm snapshot Ammad Linux - General 4 11-11-2009 10:01 AM
lvm snapshot for backup eco Linux - Server 5 03-15-2009 08:27 AM
lvm snapshot Ammad Linux - General 1 02-18-2009 08:03 AM
LVM snapshot between different Groups Ammad Linux - General 3 01-04-2009 09:02 AM
About LVM Snapshot geethusari Member Intro 1 12-03-2007 08:11 AM

All times are GMT -5. The time now is 09:28 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration