* [linux-lvm] problem with lvcreate and redirection
@ 2016-02-19 18:40 Lentes, Bernd
2016-02-19 20:31 ` Zdenek Kabelac
0 siblings, 1 reply; 6+ messages in thread
From: Lentes, Bernd @ 2016-02-19 18:40 UTC (permalink / raw)
To: LVM Mailingliste
Hi,
i have a script in which i invoke lvremove and lvcreate. With lvremove i don't have proplems but with lvcreate.
I'm redirecting stdout and stderr to a file because the script is executed by cron and i'd like to have a look afterwards if everything went fine.
The command is: lvcreate -v -L 25G -n lv_root_snapshot -s vg1/lv_root > lvcreate_with_redirection.log 2>&1. Shell does not accept further commands afterwards, but host still responds to ping. You can have a look on lvcreate_with_redirection.log here: https://hmgubox.helmholtz-muenchen.de:8001/d/b4c7025bac/ .
System seems to stop while suspending.
last lines of the log:
======================================================
...
Creating vg1-lv_root_snapshot-cow
Loading vg1-lv_root_snapshot-cow table (252:3)
Resuming vg1-lv_root_snapshot-cow (252:3)
Loading vg1-lv_root_snapshot table (252:1)
Suspending vg1-lv_root (252:0) with filesystem sync with device flush
======================================================
I did a strace on the command and that confirms it:
strace -ftt lvcreate -v -L 25G -n lv_root_snapshot -s vg1/lv_root > lvcreate_strace_with_redirection.log 2>&1
last lines of the log (you find all the mentioned logs on the link):
====================================================================
...
17:43:59.199487 ioctl(4, DM_TABLE_DEPS, 0x7875e0) = 0
17:43:59.199581 ioctl(4, DM_DEV_STATUS, 0x7875e0) = -1 ENXIO (No such device or address)
17:43:59.199680 ioctl(4, DM_DEV_STATUS, 0x7875e0) = -1 ENXIO (No such device or address)
17:43:59.199749 ioctl(4, DM_DEV_STATUS, 0x7875e0) = 0
17:43:59.199803 write(2, " ", 2 ) = 2
17:43:59.199905 write(2, " ", 2 ) = 2
17:43:59.199945 write(2, "Suspending vg1-lv_root (252:0) w"..., 69Suspending vg1-lv_root (252:0) with filesystem sync with device flush) = 69
17:43:59.199981 write(2, "\n", 1
) = 1
17:43:59.200068 ioctl(4, DM_DEV_SUSPEND
====================================================================
Issuing the command without the redirection of stderr works !
lvcreate -v -L 25G -n lv_root_snapshot -s vg1/lv_root > lvcreate_with_redirection_without_stderr.log
Snapshot is created and systems keeps on running (although snapshot is created in all cases, also with the commands which stop the server).
When i use "lvcreate -v -L 25G -n lv_root_snapshot -s vg1/lv_root > lvcreate_with_redirection_without_stderr.log" in conjunction with unbuffer, system also keeps running:
unbuffer lvcreate -v -L 25G -n lv_root_snapshot -s vg1/lv_root > lvcreate_with_redirection_unbuffer.log 2>&1
Logfile again on the internet.
For the sake of completeness i did a strace without redirection and copied afterwards the content of the terminal to the file lvcreate_strace_without_redirection.log: strace -ftt lvcreate -v -L 25G -n lv_root_snapshot -s vg1/lv_root.
System keeps on running.
Any ideas why this behaves so strange ?
Host is a virtual machine (KVM), running SLES 11 SP4 64bit. LVM is lvm2-2.02.98-0.37.2.
My root directory resides on a lv:
mount
/dev/mapper/vg1-lv_root on / type ext3 (rw,strictatime,acl,user_xattr)
...
/dev/vda3 on /boot type ext3 (rw,strictatime,acl,user_xattr)
...
The host for the vm is also SLES 11 SP4 64bit.
Bernd
--
Bernd Lentes
Systemadministration
institute of developmental genetics
Gebäude 35.34 - Raum 208
HelmholtzZentrum München
bernd.lentes@helmholtz-muenchen.de
phone: +49 (0)89 3187 1241
fax: +49 (0)89 3187 2294
Wer Visionen hat soll zum Hausarzt gehen
Helmut Schmidt
Helmholtz Zentrum München
Helmholtz Zentrum Muenchen
Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH)
Ingolstaedter Landstr. 1
85764 Neuherberg
www.helmholtz-muenchen.de
Aufsichtsratsvorsitzende: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrer: Prof. Dr. Guenther Wess, Dr. Alfons Enhsen, Renate Schlusen (komm.)
Registergericht: Amtsgericht Muenchen HRB 6466
USt-IdNr: DE 129521671
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-lvm] problem with lvcreate and redirection
2016-02-19 18:40 [linux-lvm] problem with lvcreate and redirection Lentes, Bernd
@ 2016-02-19 20:31 ` Zdenek Kabelac
2016-02-20 4:52 ` Марк Коренберг
2016-02-20 13:25 ` Lentes, Bernd
0 siblings, 2 replies; 6+ messages in thread
From: Zdenek Kabelac @ 2016-02-19 20:31 UTC (permalink / raw)
To: linux-lvm
Dne 19.2.2016 v 19:40 Lentes, Bernd napsal(a):
> Hi,
>
> i have a script in which i invoke lvremove and lvcreate. With lvremove i don't have proplems but with lvcreate.
> I'm redirecting stdout and stderr to a file because the script is executed by cron and i'd like to have a look afterwards if everything went fine.
> The command is: lvcreate -v -L 25G -n lv_root_snapshot -s vg1/lv_root > lvcreate_with_redirection.log 2>&1. Shell does not accept further commands afterwards, but host still responds to ping. You can have a look on lvcreate_with_redirection.log here: https://hmgubox.helmholtz-muenchen.de:8001/d/b4c7025bac/ .
> System seems to stop while suspending.
>
> last lines of the log:
> ======================================================
>
> ...
> Creating vg1-lv_root_snapshot-cow
> Loading vg1-lv_root_snapshot-cow table (252:3)
> Resuming vg1-lv_root_snapshot-cow (252:3)
> Loading vg1-lv_root_snapshot table (252:1)
> Suspending vg1-lv_root (252:0) with filesystem sync with device flush
> ======================================================
>
Unfortunately you can't do that if you log to the SAME volume you are
suspending - i.e. you run your command from your root volume
which is also suspended.
We could likely 'buffer' the output while in suspend mode,
and throw out the output later - but as this is seen as 'debug' help it's
assume user takes care and user place for logging which doesn't block.
So if you want to see logs - use something tmpfs location for it.
Regards
Zdenek
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-lvm] problem with lvcreate and redirection
2016-02-19 20:31 ` Zdenek Kabelac
@ 2016-02-20 4:52 ` Марк Коренберг
2016-02-20 13:25 ` Lentes, Bernd
1 sibling, 0 replies; 6+ messages in thread
From: Марк Коренберг @ 2016-02-20 4:52 UTC (permalink / raw)
To: LVM general discussion and development
> 20 ����. 2016 �., � 1:31, Zdenek Kabelac <zdenek.kabelac@gmail.com> �������(�):
>
> Dne 19.2.2016 v 19:40 Lentes, Bernd napsal(a):
>> Hi,
>>
>> i have a script in which i invoke lvremove and lvcreate. With lvremove i don't have proplems but with lvcreate.
>> I'm redirecting stdout and stderr to a file because the script is executed by cron and i'd like to have a look afterwards if everything went fine.
>> The command is: lvcreate -v -L 25G -n lv_root_snapshot -s vg1/lv_root > lvcreate_with_redirection.log 2>&1. Shell does not accept further commands afterwards, but host still responds to ping. You can have a look on lvcreate_with_redirection.log here: https://hmgubox.helmholtz-muenchen.de:8001/d/b4c7025bac/ .
>> System seems to stop while suspending.
>>
>> last lines of the log:
>> ======================================================
>>
>> ...
>> Creating vg1-lv_root_snapshot-cow
>> Loading vg1-lv_root_snapshot-cow table (252:3)
>> Resuming vg1-lv_root_snapshot-cow (252:3)
>> Loading vg1-lv_root_snapshot table (252:1)
>> Suspending vg1-lv_root (252:0) with filesystem sync with device flush
>> ======================================================
>
>
> Unfortunately you can't do that if you log to the SAME volume you are suspending - i.e. you run your command from your root volume
> which is also suspended.
>
> We could likely 'buffer' the output while in suspend mode,
> and throw out the output later - but as this is seen as 'debug' help it's assume user takes care and user place for logging which doesn't block.
>
> So if you want to see logs - use something tmpfs location for it.
Why this happen ? I thought that operations with page cache will not be suspended on fsfreeze().
>
> Regards
>
>
> Zdenek
>
> _______________________________________________
> 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/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-lvm] problem with lvcreate and redirection
2016-02-19 20:31 ` Zdenek Kabelac
2016-02-20 4:52 ` Марк Коренберг
@ 2016-02-20 13:25 ` Lentes, Bernd
2016-02-20 15:04 ` Zdenek Kabelac
1 sibling, 1 reply; 6+ messages in thread
From: Lentes, Bernd @ 2016-02-20 13:25 UTC (permalink / raw)
To: LVM Mailingliste
----- Am 19. Feb 2016 um 21:31 schrieb Zdenek Kabelac zdenek.kabelac@gmail.com:
> Dne 19.2.2016 v 19:40 Lentes, Bernd napsal(a):
>> Hi,
>>
>> i have a script in which i invoke lvremove and lvcreate. With lvremove i don't
>> have proplems but with lvcreate.
>> I'm redirecting stdout and stderr to a file because the script is executed by
>> cron and i'd like to have a look afterwards if everything went fine.
>> The command is: lvcreate -v -L 25G -n lv_root_snapshot -s vg1/lv_root >
>> lvcreate_with_redirection.log 2>&1. Shell does not accept further commands
>> afterwards, but host still responds to ping. You can have a look on
>> lvcreate_with_redirection.log here:
>> https://hmgubox.helmholtz-muenchen.de:8001/d/b4c7025bac/ .
>> System seems to stop while suspending.
>>
>> last lines of the log:
>> ======================================================
>>
>> ...
>> Creating vg1-lv_root_snapshot-cow
>> Loading vg1-lv_root_snapshot-cow table (252:3)
>> Resuming vg1-lv_root_snapshot-cow (252:3)
>> Loading vg1-lv_root_snapshot table (252:1)
>> Suspending vg1-lv_root (252:0) with filesystem sync with device flush
>> ======================================================
>>
>
>
> Unfortunately you can't do that if you log to the SAME volume you are
> suspending - i.e. you run your command from your root volume
> which is also suspended.
>
> We could likely 'buffer' the output while in suspend mode,
> and throw out the output later - but as this is seen as 'debug' help it's
> assume user takes care and user place for logging which doesn't block.
>
> So if you want to see logs - use something tmpfs location for it.
>
> Regards
>
>
> Zdenek
>
Hi Zdenek,
thanks for your answer. I redirected the output already to another partition, but system still stopped. Maybe because the partition is on the same disk as the lv ? Whole disk is suspended ? It's not possible to suspend just a partition ? I will try with tmpfs or something else.
But does that mean that redirection is generally not possible when suspending a lv ? Or just in my case because i invoke lvcreate ? What is about other programs having redirections during the suspend ? And why does it work when i just rediredt stdout ? When i redirect stdout and stderr system stops.
Bernd
Helmholtz Zentrum München
Helmholtz Zentrum Muenchen
Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH)
Ingolstaedter Landstr. 1
85764 Neuherberg
www.helmholtz-muenchen.de
Aufsichtsratsvorsitzende: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrer: Prof. Dr. Guenther Wess, Dr. Alfons Enhsen, Renate Schlusen (komm.)
Registergericht: Amtsgericht Muenchen HRB 6466
USt-IdNr: DE 129521671
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-lvm] problem with lvcreate and redirection
2016-02-20 13:25 ` Lentes, Bernd
@ 2016-02-20 15:04 ` Zdenek Kabelac
2016-02-20 16:50 ` Lentes, Bernd
0 siblings, 1 reply; 6+ messages in thread
From: Zdenek Kabelac @ 2016-02-20 15:04 UTC (permalink / raw)
To: LVM general discussion and development
Dne 20.2.2016 v 14:25 Lentes, Bernd napsal(a):
>
>
> ----- Am 19. Feb 2016 um 21:31 schrieb Zdenek Kabelac zdenek.kabelac@gmail.com:
>
>> Dne 19.2.2016 v 19:40 Lentes, Bernd napsal(a):
>>> Hi,
>>>
>>> i have a script in which i invoke lvremove and lvcreate. With lvremove i don't
>>> have proplems but with lvcreate.
>>> I'm redirecting stdout and stderr to a file because the script is executed by
>>> cron and i'd like to have a look afterwards if everything went fine.
>>> The command is: lvcreate -v -L 25G -n lv_root_snapshot -s vg1/lv_root >
>>> lvcreate_with_redirection.log 2>&1. Shell does not accept further commands
>>> afterwards, but host still responds to ping. You can have a look on
>>> lvcreate_with_redirection.log here:
>>> https://hmgubox.helmholtz-muenchen.de:8001/d/b4c7025bac/ .
>>> System seems to stop while suspending.
>>>
>>> last lines of the log:
>>> ======================================================
>>>
>>> ...
>>> Creating vg1-lv_root_snapshot-cow
>>> Loading vg1-lv_root_snapshot-cow table (252:3)
>>> Resuming vg1-lv_root_snapshot-cow (252:3)
>>> Loading vg1-lv_root_snapshot table (252:1)
>>> Suspending vg1-lv_root (252:0) with filesystem sync with device flush
>>> ======================================================
>>>
>>
>>
>> Unfortunately you can't do that if you log to the SAME volume you are
>> suspending - i.e. you run your command from your root volume
>> which is also suspended.
>>
>> We could likely 'buffer' the output while in suspend mode,
>> and throw out the output later - but as this is seen as 'debug' help it's
>> assume user takes care and user place for logging which doesn't block.
>>
>> So if you want to see logs - use something tmpfs location for it.
>>
>> Regards
>>
>>
>> Zdenek
>>
>
> Hi Zdenek,
>
> thanks for your answer. I redirected the output already to another partition, but system still stopped. Maybe because the partition is on the same disk as the lv ? Whole disk is suspended ? It's not possible to suspend just a partition ? I will try with tmpfs or something else.
> But does that mean that redirection is generally not possible when suspending a lv ? Or just in my case because i invoke lvcreate ? What is about other programs having redirections during the suspend ? And why does it work when i just rediredt stdout ? When i redirect stdout and stderr system stops.
>
Your 'partition' layout isn't clear - but anyway - debugging command when you
run it from a partition you try to suspend is 'tricky'.
Suspend basically stops any read/write operation from suspended device.
So you just need to be sure there is nothing on logging path which might be
blocked.
So is your command blocked when you log into ramdisk ?
Are you using some recent version of lvm2 ?
Zdenek
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-lvm] problem with lvcreate and redirection
2016-02-20 15:04 ` Zdenek Kabelac
@ 2016-02-20 16:50 ` Lentes, Bernd
0 siblings, 0 replies; 6+ messages in thread
From: Lentes, Bernd @ 2016-02-20 16:50 UTC (permalink / raw)
To: LVM Mailingliste
>>>>
>>>
>>>
>>> Unfortunately you can't do that if you log to the SAME volume you are
>>> suspending - i.e. you run your command from your root volume
>>> which is also suspended.
>>>
>>> We could likely 'buffer' the output while in suspend mode,
>>> and throw out the output later - but as this is seen as 'debug' help it's
>>> assume user takes care and user place for logging which doesn't block.
>>>
>>> So if you want to see logs - use something tmpfs location for it.
>>>
>>> Regards
>>>
>>>
>>> Zdenek
>>>
>>
>> Hi Zdenek,
>>
>> thanks for your answer. I redirected the output already to another partition,
>> but system still stopped. Maybe because the partition is on the same disk as
>> the lv ? Whole disk is suspended ? It's not possible to suspend just a
>> partition ? I will try with tmpfs or something else.
>> But does that mean that redirection is generally not possible when suspending a
>> lv ? Or just in my case because i invoke lvcreate ? What is about other
>> programs having redirections during the suspend ? And why does it work when i
>> just rediredt stdout ? When i redirect stdout and stderr system stops.
>>
>
>
> Your 'partition' layout isn't clear - but anyway - debugging command when you
> run it from a partition you try to suspend is 'tricky'.
> Suspend basically stops any read/write operation from suspended device.
> So you just need to be sure there is nothing on logging path which might be
> blocked.
>
> So is your command blocked when you log into ramdisk ?
> Are you using some recent version of lvm2 ?
>
>
> Zdenek
>
Hi,
i have two partitions on the disk: One for /boot and one as a lv for /.
I will try to redirect to a ramdisk and inform you.
LVM is lvm2-2.02.98-0.37.2
Bernd
Helmholtz Zentrum München
Helmholtz Zentrum Muenchen
Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH)
Ingolstaedter Landstr. 1
85764 Neuherberg
www.helmholtz-muenchen.de
Aufsichtsratsvorsitzende: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrer: Prof. Dr. Guenther Wess, Dr. Alfons Enhsen, Renate Schlusen (komm.)
Registergericht: Amtsgericht Muenchen HRB 6466
USt-IdNr: DE 129521671
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-02-20 16:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-19 18:40 [linux-lvm] problem with lvcreate and redirection Lentes, Bernd
2016-02-19 20:31 ` Zdenek Kabelac
2016-02-20 4:52 ` Марк Коренберг
2016-02-20 13:25 ` Lentes, Bernd
2016-02-20 15:04 ` Zdenek Kabelac
2016-02-20 16:50 ` Lentes, Bernd
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.