linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* Re: [linux-lvm] problem with lvcreate and redirection of stdout/stderr
@ 2014-08-22  9:02 Lentes, Bernd
  2014-08-22 10:39 ` Alasdair G Kergon
  0 siblings, 1 reply; 7+ messages in thread
From: Lentes, Bernd @ 2014-08-22  9:02 UTC (permalink / raw)
  To: LVM general discussion and development


Alasdair wrote:

On Thu, Aug 21, 2014 at 11:57:51AM -0500, Roger Heflin wrote:
> I can see how with the vg suspended that might have a problem.

> But nothing should be getting written to stderr while the device is suspended.


Hi,

i don't understand what you mean with "should be getting written". Does that mean "it's not possible that something is written" or "it would be better if nothing is written" ?

Bernd

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

Helmholtz Zentrum München
Deutsches Forschungszentrum für Gesundheit und Umwelt (GmbH)
Ingolstädter Landstr. 1
85764 Neuherberg
www.helmholtz-muenchen.de
Aufsichtsratsvorsitzende: MinDir´in Bärbel Brumme-Bothe
Geschäftsführer: Prof. Dr. Günther Wess, Dr. Nikolaus Blum, Dr. Alfons Enhsen
Registergericht: Amtsgericht München HRB 6466
USt-IdNr: DE 129521671

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [linux-lvm] problem with lvcreate and redirection of stdout/stderr
@ 2014-08-20 15:27 Lentes, Bernd
  2014-08-20 15:50 ` Alasdair G Kergon
  0 siblings, 1 reply; 7+ messages in thread
From: Lentes, Bernd @ 2014-08-20 15:27 UTC (permalink / raw)
  To: LVM general discussion and development

Hi ML,

i'm writing a script to update my servers. Before updating, i'd like to create a snapshot of the root-directory (/). If something goes wrong with the update, I have a consistent backup.
I try to redirect stdout and stderr to a logfile for being able to check everything afterwards. The redirection has problems with lvcreate.
This is my script (excerpt):

============================================================
lvremove -fv /dev/vg1/lv_root_snapshot &> /var/log/update.log

lvcreate -v -L 45G -n lv_root_snapshot -s vg1/lv_root >> /var/log/update.log 2>&1

zypper -n up -y -t patch  --skip-interactive >> /var/log/update.log 2>&1
============================================================

With the second line I try to create the lv and redirect stdout/stderr to a log file.
The whole system stop by executing the second line, this are the last lines in my log:

============================================================
lvcreate    Setting logging type to disk
lvcreate    Setting chunksize to 8 sectors.
lvcreate    Finding volume group "vg1"
lvcreate    Archiving volume group "vg1" metadata (seqno 99).
lvcreate    Creating logical volume lv_root_snapshot
lvcreate    Creating volume group backup "/etc/lvm/backup/vg1" (seqno 100).
lvcreate    Found volume group "vg1"
lvcreate    activation/volume_list configuration setting not defined: Checking only host tags for vg1/lv_root_snapshot
lvcreate    Creating vg1-lv_root_snapshot
lvcreate    Loading vg1-lv_root_snapshot table (252:1)
lvcreate    Resuming vg1-lv_root_snapshot (252:1)
lvcreate    Clearing start of logical volume "lv_root_snapshot"
lvcreate    Creating logical volume snapshot0
lvcreate    Found volume group "vg1"
lvcreate    Found volume group "vg1"
lvcreate    Creating vg1-lv_root-real
lvcreate    Loading vg1-lv_root-real table (252:2)
lvcreate    Loading vg1-lv_root table (252:0)
lvcreate    Creating vg1-lv_root_snapshot-cow
lvcreate    Loading vg1-lv_root_snapshot-cow table (252:3)
lvcreate    Resuming vg1-lv_root_snapshot-cow (252:3)
lvcreate    Loading vg1-lv_root_snapshot table (252:1)
lvcreate    Suspending vg1-lv_root (252:0) with filesystem sync with device flush
===========================================================

I tried it several times, and the system always stop at this point. When I execute the same command manually in a shell no change. Stop.
Redirecting the lvremove command on a shell in the same manner is working fine:

lvremove -fv /dev/vg1/lv_root_snapshot >> /var/log/update.log 2>&1
system continues running.

lvcreate manually in a shell and only redirecting stdout is working fine:

lvcreate -v -L 45G -n lv_root_snapshot -s vg1/lv_root >> /var/log/update.log
system continues running

Only the combination of redirecting stdout and stderr to the logfile stops the system completely:
lvcreate -v -L 45G -n lv_root_snapshot -s vg1/lv_root >> /var/log/update.log 2>&1


Any ideas ?


my system:

SLES 11 SP3 64bit
vm58820-6:~ # lvm version
  LVM version:     2.02.98(2) (2012-10-15)
  Library version: 1.03.01 (2011-10-15)
  Driver version:  4.23.0
1 lv for the root-directory, /boot is a "real" partition
1pv, 1 vg

Bernd


--
Bernd Lentes

Systemadministration
Institut f�r Entwicklungsgenetik
Geb�ude 35.34 - Raum 208
HelmholtzZentrum m�nchen
bernd.lentes@helmholtz-muenchen.de
phone: +49 89 3187 1241
fax:   +49 89 3187 2294
http://www.helmholtz-muenchen.de/idg

Die Freiheit wird nicht durch weniger Freiheit verteidigt



Helmholtz Zentrum M�nchen
Deutsches Forschungszentrum f�r Gesundheit und Umwelt (GmbH)
Ingolst�dter Landstr. 1
85764 Neuherberg
www.helmholtz-muenchen.de
Aufsichtsratsvorsitzende: MinDir�in B�rbel Brumme-Bothe
Gesch�ftsf�hrer: Prof. Dr. G�nther Wess, Dr. Nikolaus Blum, Dr. Alfons Enhsen
Registergericht: Amtsgericht M�nchen HRB 6466
USt-IdNr: DE 129521671

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-08-22 10:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-22  9:02 [linux-lvm] problem with lvcreate and redirection of stdout/stderr Lentes, Bernd
2014-08-22 10:39 ` Alasdair G Kergon
  -- strict thread matches above, loose matches on Subject: below --
2014-08-20 15:27 Lentes, Bernd
2014-08-20 15:50 ` Alasdair G Kergon
2014-08-20 17:20   ` Lentes, Bernd
2014-08-21 16:57     ` Roger Heflin
2014-08-21 17:20       ` Alasdair G Kergon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).