Re: Please help! Lost my LVM VG...
Andrew Junev wrote: I'm prompted to enter a root password to get to system maintenance, or Ctrl+D to continue. In the system maintenance I can see there's /dev/VolGroup00 but there's no /dev/VolTerabytes00, so my newly-created VG seem to be missing! Running the command: vgchange -ay VolTerabytes00 Should activate the VG, assuming that all PVs are present (and any needed modules have been loaded). I tried running lvm and it says Locking type 1 initialisation failed no matter what command I enter... Check that the file system providing /var has been mounted and is writable. Assuming it's part of / you probably just need to run: mount -n -oremount,rw / Regards, Bryn. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Please help! Lost my LVM VG...
Thursday, February 12, 2009, 9:42:38 PM, you wrote: Running the command: vgchange -ay VolTerabytes00 Should activate the VG, assuming that all PVs are present (and any needed modules have been loaded). I tried running lvm and it says Locking type 1 initialisation failed no matter what command I enter... Check that the file system providing /var has been mounted and is writable. Assuming it's part of / you probably just need to run: mount -n -oremount,rw / Ah, that worked! Thank you! What shall I do to automatically activate this VG during boot? -- Best regards, Andrew -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Please help! Lost my LVM VG...
Andrew Junev wrote: Thursday, February 12, 2009, 9:42:38 PM, you wrote: Running the command: vgchange -ay VolTerabytes00 Should activate the VG, assuming that all PVs are present (and any needed modules have been loaded). I tried running lvm and it says Locking type 1 initialisation failed no matter what command I enter... Check that the file system providing /var has been mounted and is writable. Assuming it's part of / you probably just need to run: mount -n -oremount,rw / Ah, that worked! Thank you! What shall I do to automatically activate this VG during boot? You need to understand why it wasn't being activated automatically. Boot logs (dmesg and/or /var/log/messages) would help here. Normally, devices are scanned for LVM metadata when rc.sysinit runs. There were some bugs in older releases (f8 is no longer supported/maintained) where udev would not wait long enough for some devices to appear, causing these scans to miss the VG. That sounds plausible here since the vgchange -ay worked after the system had booted but there's not really enough information to say for sure. Try adding a sleep 5 or udevsettle --timeout=30 command to rc.sysinit above each of the LVM activation commands. Regards, Bryn. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Please help! Lost my LVM VG...
Andrew Junev wrote: Thursday, February 12, 2009, 9:42:38 PM, you wrote: Running the command: vgchange -ay VolTerabytes00 Should activate the VG, assuming that all PVs are present (and any needed modules have been loaded). I tried running lvm and it says Locking type 1 initialisation failed no matter what command I enter... Check that the file system providing /var has been mounted and is writable. Assuming it's part of / you probably just need to run: mount -n -oremount,rw / Ah, that worked! Thank you! What shall I do to automatically activate this VG during boot? If I understand the VG commands correctly, you just did. Mikkel -- Do not meddle in the affairs of dragons, for thou art crunchy and taste good with Ketchup! signature.asc Description: OpenPGP digital signature -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Please help! Lost my LVM VG...
On Thu, 2009-02-12 at 19:09 +, Bryn M. Reeves wrote: There were some bugs in older releases (f8 is no longer supported/maintained) where udev would not wait long enough for some devices to appear, causing these scans to miss the VG. That sounds plausible here since the vgchange -ay worked after the system had booted but there's not really enough information to say for sure. Try adding a sleep 5 or udevsettle --timeout=30 command to rc.sysinit above each of the LVM activation commands. I don't use LVM, but I've had problems with udevsettle since F10 came out. I have a permanently-connected USB external drive (an Iomega 500GB unit) and every time I reboot the following happens: 1) Boot fails because fsck can't find the drive 2) Drop to shell 3) Run 'mount -remount ...' 4) Edit /etc/fstab and comment out the offending line 5) Ctrl-D and rerun the boot 6) Wait for the login window 7) Switch to another VT 8) Login as root and revert the edit to /etc/fstab 9) Run mount 10) Switch back to VT1 and log in. This gets old very quickly I can tell you. Read all about it at https://bugzilla.redhat.com/show_bug.cgi?id=471217 poc -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Please help! Lost my LVM VG...
Mikkel L. Ellertson wrote: Andrew Junev wrote: Thursday, February 12, 2009, 9:42:38 PM, you wrote: Running the command: vgchange -ay VolTerabytes00 Should activate the VG, assuming that all PVs are present (and any needed modules have been loaded). I tried running lvm and it says Locking type 1 initialisation failed no matter what command I enter... Check that the file system providing /var has been mounted and is writable. Assuming it's part of / you probably just need to run: mount -n -oremount,rw / Ah, that worked! Thank you! What shall I do to automatically activate this VG during boot? If I understand the VG commands correctly, you just did. I think the OP wants his VG to activate without the need for him to give the root password at each boot and mess around running commands by hand :) Bryn. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Please help! Lost my LVM VG...
Hello Bryn, You need to understand why it wasn't being activated automatically. Boot logs (dmesg and/or /var/log/messages) would help here. Normally, devices are scanned for LVM metadata when rc.sysinit runs. There were some bugs in older releases (f8 is no longer supported/maintained) where udev would not wait long enough for some devices to appear, causing these scans to miss the VG. That sounds plausible here since the vgchange -ay worked after the system had booted but there's not really enough information to say for sure. Try adding a sleep 5 or udevsettle --timeout=30 command to rc.sysinit above each of the LVM activation commands. /var/log/messages doesn't contain any information about that problem. The error happened too early during boot - so that the data didn't get into the log files (disks were mounted in read-only mode). Anyway, the problem does not appear anymore. I just restarted the system several times (including complete power-down / power-up cycle), to be sure. I don't know what the reason was, but it seem to be fixed now! Thank you very-very-very much for your help!!! -- Best regards, Andrew -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Please help! Lost my LVM VG...
Andrew Junev wrote: /var/log/messages doesn't contain any information about that problem. The error happened too early during boot - so that the data didn't get into the log files (disks were mounted in read-only mode). You can work around this by commenting out the file systems on the problem VG from the fstab and allowing the system to boot normally. You should find bootup messages in /var/log/boot.log (or dmesg) and /var/log/messages. Anyway, the problem does not appear anymore. I just restarted the system several times (including complete power-down / power-up cycle), to be sure. Cool - at least you'll be prepared if it ever happens again :-) I don't know what the reason was, but it seem to be fixed now! Thank you very-very-very much for your help!!! Np! Glad it's working! Cheers, Bryn. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Please help! Lost my LVM VG...
Bryn M. Reeves wrote: Mikkel L. Ellertson wrote: Andrew Junev wrote: What shall I do to automatically activate this VG during boot? If I understand the VG commands correctly, you just did. I think the OP wants his VG to activate without the need for him to give the root password at each boot and mess around running commands by hand :) Bryn. I thought that running vgchange -ay VolTerabytes00 would have modified /etc/lvm/cache/.cache so that the VG would stay active. (I think I have the correct file.) This one reason the / file system had to be remounted rw. Mikkel -- Do not meddle in the affairs of dragons, for thou art crunchy and taste good with Ketchup! signature.asc Description: OpenPGP digital signature -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Please help! Lost my LVM VG...
Mikkel L. Ellertson wrote: Bryn M. Reeves wrote: Mikkel L. Ellertson wrote: Andrew Junev wrote: What shall I do to automatically activate this VG during boot? If I understand the VG commands correctly, you just did. I think the OP wants his VG to activate without the need for him to give the root password at each boot and mess around running commands by hand :) Bryn. I thought that running vgchange -ay VolTerabytes00 would have modified /etc/lvm/cache/.cache so that the VG would stay active. (I The cache is revalidated each time the tools run. If VGs are only being activated at boot when listed in that file, it's a bug. think I have the correct file.) This one reason the / file system had to be remounted rw. No. Type 1 locking (local file based locks stored in /var) failed to initialise because the directory /var/lock/lvm was not writable. Regards, Bryn. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Please help! Lost my LVM VG...
Bryn M. Reeves wrote: Mikkel L. Ellertson wrote: Bryn M. Reeves wrote: Mikkel L. Ellertson wrote: Andrew Junev wrote: What shall I do to automatically activate this VG during boot? If I understand the VG commands correctly, you just did. I think the OP wants his VG to activate without the need for him to give the root password at each boot and mess around running commands by hand :) Bryn. I thought that running vgchange -ay VolTerabytes00 would have modified /etc/lvm/cache/.cache so that the VG would stay active. (I The cache is revalidated each time the tools run. If VGs are only being activated at boot when listed in that file, it's a bug. think I have the correct file.) This one reason the / file system had to be remounted rw. No. Type 1 locking (local file based locks stored in /var) failed to initialise because the directory /var/lock/lvm was not writable. Regards, Bryn. Strange - /var/lock/lvm is empty, and its date does not correspond to the last boot time. The date on the directory, as well as /etc/lvm/cache/.cache match up to when LVM was last updated. On the other hand, I may be wrong about a file being updated. It looks like there may be a bit set on the LV itself. (I am going to have to refresh my memory.) After further reading, the OP could have run the command without remounting / rw. He could have run: vgchange -ay --ignorelockingfailure VolTerabytes00 In any case, it would be interesting to have the OP reboot, and see if the VG is active on reboot. Mikkel -- Do not meddle in the affairs of dragons, for thou art crunchy and taste good with Ketchup! signature.asc Description: OpenPGP digital signature -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Please help! Lost my LVM VG...
Mikkel L. Ellertson wrote: Strange - /var/lock/lvm is empty, and its date does not correspond It's always empty unless an LVM tool is running (or you've disabled locking or are using some non-local locking mode for all your VGs). Try running e.g. vgchange in a debugger. Set a breakpoint on vgchange_single and go look in that directory when the process breaks on that symbol. E.g: (gdb) break vgchange_single Breakpoint 1 at 0x4228b0: file vgchange.c, line 512. (gdb) r -ay tvg0 Starting program: /sbin/vgchange -ay tvg0 [Thread debugging using libthread_db enabled] File descriptor 3 left open File descriptor 4 left open File descriptor 5 left open [New Thread 0x7fc245280780 (LWP 2581)] Breakpoint 1, vgchange_single (cmd=0x2646500, vg_name=0x265f3e0 tvg0, vg=0x265fda0, consistent=1, handle=0x0) at vgchange.c:512 512 { Missing separate debuginfos, use: debuginfo-install glibc.x86_64 libselinux.x86_64 libsepol.x86_64 ncurses.x86_64 readline.x86_64 (gdb) [1]+ Stopped gdb /sbin/vgchange # ls /var/lock/lvm/ V_tvg0 # ll -i /var/lock/lvm/V_tvg0 88047 -rwx-- 1 root root 0 2009-02-12 20:49 /var/lock/lvm/V_tvg0 # grep 88047 /proc/locks 1: FLOCK ADVISORY READ 2581 fd:01:88047 0 EOF You're can also confirm this by inspecting the code in lib/locking/file_locking.c in the LVM2 sources. to the last boot time. The date on the directory, as well as /etc/lvm/cache/.cache match up to when LVM was last updated. The cache file is a list of LVM capable devices that pass the filters defined in lvm.conf: nothing more. It's simply an optimisation to avoid needless scanning of entries in /dev. Just take a look at the file: /etc/lvm/cache/.cache # This file is automatically maintained by lvm. persistent_filter_cache { valid_devices=[ /dev/dm-6, /dev/ram11 ... ] } Nothing stored in here about activation. See also the comments in lvm.conf: # The results of the filtering are cached on disk to avoid # rescanning dud devices (which can take a very long time). # By default this cache is stored in the /etc/lvm/cache directory # in a file called '.cache'. # It is safe to delete the contents: the tools regenerate it. # (The old setting 'cache' is still respected if neither of # these new ones is present.) cache_dir = /etc/lvm/cache cache_file_prefix = It's *always* safe to delete the file since it can always be regenerated by the tools - this would not be true if it stored activation flags for VGs (you'd fail to activate them on a reboot). On the other hand, I may be wrong about a file being updated. It looks like there may be a bit set on the LV itself. (I am going to No. There's nothing in the LVM metadata for controlling this (unless you're thinking of the exported flag which doesn't come into play here since it must be set/cleared by the administrator) - take a look at the metadata files in /etc/lvm/{archive,backup}. have to refresh my memory.) After further reading, the OP could have run the command without remounting / rw. He could have run: vgchange -ay --ignorelockingfailure VolTerabytes00 Why bother when you can remount the fs and have working locking? The --ignorelockingfailure flag is only intended to allow activation of VGs during boot time, e.g. in a clustered environment when the daemons required to support the cluster infrastructure are not yet running. See the recent discussion of the proposed new implementation of this option on lvm-devel and the discussion around whether the configuration file equivalent should be renamed as boottime_locking. In any case, it would be interesting to have the OP reboot, and see if the VG is active on reboot. Read the thread :) The OP has now rebooted several times and the VG has been correctly activated each time. I am guessing that there was a timing issue and the underlying PVs were not present at the time the vgchange commands in rc.sysinit ran but without logs it's just speculation. Regards, Bryn. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Please help! Lost my LVM VG...
Thursday, February 12, 2009, 11:29:07 PM, you wrote: In any case, it would be interesting to have the OP reboot, and see if the VG is active on reboot. I did. I even powered the system down. It starts now without that problem and everything gets mounted automatically during boot. So the problem went away when I activated the VG manually. P.S. What does the 'OP' mean? Something like 'Original Poster'? :) -- Best regards, Andrew -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: Please help! Lost my LVM VG...
On Thu, 2009-02-12 at 23:56 +0300, Andrew Junev wrote: P.S. What does the 'OP' mean? Something like 'Original Poster'? :) Yes, it's accepted usage. Not that common but not extremely rare either. poc -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines