LinHES Forums http://forum.linhes.org/ |
|
(Solved) LVM Troubles, Can't connect to the Backend http://forum.linhes.org/viewtopic.php?f=6&t=15478 |
Page 1 of 1 |
Author: | ghede [ Sun Jun 03, 2007 1:59 pm ] |
Post subject: | (Solved) LVM Troubles, Can't connect to the Backend |
I need some help. For the life of me, I cannot get my LVM setup to work. First, the basics... Linux newb Hardware... Intel P4 1.8 768meg Ram Original drive = 300 gig HD as hda, cable select master IDE channel 1 New drive = 500 gig HD as hdb, cable select slave IDE channel 1 Running R5E50 on a BE/FE combo. Running very well for the last 5 or 6 months. The wife and kids love it and we use it to it's near full potential as an entertainment device. And now I'm out of space on my original 300g drive. I installed the 500g drive and followed the manual LVM install on the wiki. Rebooted, and it could not connect to the backend. When it didn't work, I thought I screwed it up, I then did it two other times, using the createlvm script and even used webmin to create the LVM to no avail. Everytime it reboots, according to the LVM setup in webmin, it doesn't mount the LVM. I then issue a mount /dev/vg/myth refresh webmin and it now shows it as mounted. Now if I issue a backend restart using: /etc/init.d/mythtv-backend restart it works. So.... how can I get it to boot up and just work. According to the wiki, it should just work, if I'm reading it correctly. The backend log shows this when it won't connect, and before I mount the vg, but this seems obvious as it hasn't mounted: 2007-05-28 10:30:35.627 Enabled verbose msgs: important general /myth/tv/nfslockfile.lock: No such file or directory Unable to open lockfile! Be sure that '/myth/tv' exists and that both the directory and that file are writeable by this user. I see a directory on the original drive called /mnt/hdb1. It's a copy of /myth. ? root@mythtv:/# df -h Filesystem Size Used Avail Use% Mounted on /dev/hda1 4.7G 2.1G 2.4G 47% / /dev/hda3 274G 264G 11G 97% /myth tmpfs 378M 4.0K 378M 1% /dev/shm /dev/mapper/vg-myth 466G 261G 206G 56% /mnt/hdb1 root@mythtv:/# df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/hda1 500992 91948 409044 19% / /dev/hda3 70080 14971 55109 22% /myth tmpfs 96598 3 96595 1% /dev/shm /dev/mapper/vg-myth 119264 14971 104293 13% /mnt/hdb1 My fstab: # /etc/fstab: filesystem table. # # filesystem mountpoint type options dump pass /dev/hda1 / ext3 defaults,errors=remount-ro 0 1 /dev/hda3 /myth ext3 defaults,auto 0 2 #/dev/vg/myth /myth auto defaults,auto 0 2 proc /proc proc defaults 0 0 /dev/fd0 /floppy vfat defaults,user,noauto,showexec,umask=022 0 0 usbfs /proc/bus/usb usbfs devmode=0666 0 0 sysfs /sys sysfs defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 /dev/cdrom /cdrom iso9660 defaults,ro,user,noexec,noauto 0 0 # Added by KNOPPIX /dev/hda2 none swap defaults 0 0 #/dev/vg/myth /myth auto defaults,auto 0 2 The VG is commented out as I need the system to work until I figure this out. I just uncomment it and reboot when I test it. You can see I also ran the create_lvm.sh script from the 'Added by KNOPPIX' VG line. I found a few posts, one of them mentioned permissions, so I chown mythtv:mythtv /mnt/hdb1/* chmod 777 /mnt/hdb1/* Good - Bad? Trying to fix it, I seem to have more questions than answers. Am I over my head? Cut and paste the directions problem? As an old girlfriend used to say "I'm so in the weeds"!! Jim |
Author: | slowtolearn [ Sun Jun 03, 2007 2:16 pm ] |
Post subject: | Re: LVM Troubles, Can't connect to the Backend |
ghede wrote: My fstab: Comment the /dev/hda3 line.# /etc/fstab: filesystem table. # # filesystem mountpoint type options dump pass /dev/hda1 / ext3 defaults,errors=remount-ro 0 1 /dev/hda3 /myth ext3 defaults,auto 0 2 #/dev/vg/myth /myth auto defaults,auto 0 2 proc /proc proc defaults 0 0 /dev/fd0 /floppy vfat defaults,user,noauto,showexec,umask=022 0 0 usbfs /proc/bus/usb usbfs devmode=0666 0 0 sysfs /sys sysfs defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 /dev/cdrom /cdrom iso9660 defaults,ro,user,noexec,noauto 0 0 # Added by KNOPPIX /dev/hda2 none swap defaults 0 0 #/dev/vg/myth /myth auto defaults,auto 0 2 ghede wrote: The VG is commented out as I need the system to work until I figure this out. I just uncomment it and reboot when I test it. You can see I also ran the create_lvm.sh script from the 'Added by KNOPPIX' VG line. Actually, that was placed there during initial install when swap was added.ghede wrote: I found a few posts, one of them mentioned permissions, so I I wouldn't make a habit of that! chown mythtv:mythtv /mnt/hdb1/* chmod 777 /mnt/hdb1/* Good - Bad? ![]() Try commenting out the /dev/hda3 line, uncomment one of your /dev/vg/myth lines and reboot. Let's see what that gives you... |
Author: | ghede [ Sun Jun 03, 2007 3:02 pm ] |
Post subject: | |
Thanks for such a quick reply ![]() Ok, tried it, no joy. Same thing, doesn't mount, and backend won't start. Quote: I wouldn't make a habit of that! Wink But I suspect you'll be fine. Whew!
The sun finally came out in Monterey ./fog bad/sun good.sh Taking kids out. Will play more in the eve. I've been trying to fix this for a while so a few more hours are nothin'. |
Author: | slowtolearn [ Sun Jun 03, 2007 3:16 pm ] |
Post subject: | |
ghede wrote: Thanks for such a quick reply I mount my LVMs using an init script. Try this:
![]() Ok, tried it, no joy. Same thing, doesn't mount, and backend won't start. 1 - Comment the /dev/vg/myth lines in /etc/fstab 2 - Create a script in /etc/rc5.d called S19mount and add Code: #!/bin/sh
mount /dev/vg/myth /myth 3 - Set the permissions on S19mount - chmod 755 /etc/rc5.d/S19mount 4 - Reboot I don't recall the specifics, but I remember running into problems mounting my LVMs from fstab (not KM-specific, these are on Slackware). |
Author: | ghede [ Sun Jun 03, 2007 6:04 pm ] |
Post subject: | |
Done. No joy. After rebooting, in webmin it says "Not in use" as opposed to stating "For mounting on /myth as *" after a reboot with the vg line uncommented. Now, I didn't try to manually mount it, from the "Not in use" line, it appears that it wouldn't anyway. Google brings up this link http://riseuplabs.org/grimoire//storage ... on_restart I swear I saw "vgscan" and then a "vgchange -ay" located in a script somewhere but cannot remember which one. Let me look back... Ok, there in the /etc/init.d/lvm script. I see the entries there, so they are being run. But at the right time? Poking around I found /etc/init.d/mountall.sh which according to the description, mounts all filesystems. Here is the beginning of the script. #! /bin/sh ### BEGIN INIT INFO # Provides: mountall # Required-Start: checkfs # Required-Stop: # Should-Start: lvm # Should-Stop: # Default-Start: S # Default-Stop: # Short-Description: Mount all filesystems. # Description: ### END INIT INFO PATH=/sbin:/bin . /lib/init/vars.sh . /lib/lsb/init-functions . /lib/init/mount-functions.sh More questions than answers, I know. A great linux learning experience in the making, for me anyway ![]() slowtolearn, I really appreciate your help. Thanks. |
Author: | slowtolearn [ Sun Jun 03, 2007 6:31 pm ] |
Post subject: | |
ghede wrote: I swear I saw "vgscan" and then a "vgchange -ay" located in a script somewhere but cannot remember which one. Let me look back... I've never used the create_lvm.sh script, but looking through it on my system tells me you should have an /etc/rc5.d/S26lvm file, so you need to change the name of that script you made from S19mount to S27mount (something after 26, so vgscan and vgchange have run, then the LVM gets mounted).
Ok, there in the /etc/init.d/lvm script. I see the entries there, so they are being run. But at the right time? |
Author: | ghede [ Sun Jun 03, 2007 7:02 pm ] |
Post subject: | |
Quote: you should have an /etc/rc5.d/S26lvm file
root@mythtv:/etc/rc5.d# ls S10sysklogd S20bootsplash S20mysql S20openbsd-inetd S20webmin S45autofs S89cron S99lvm S11klogd S20lirc S20nvidia-glx S20samba S27mount S50mythtv-backend S90install-nvidia-debian S99rmnologin S20apache2 S20makedev S20nvidia-kernel S20ssh S40dbus S85ntp S99folding@home I don't see that file on my system. Unfortunately, same problem with the S27mount file. But it sounds like my wag about timing might be right. I did a "root@mythtv:/# locate S26lvm" and it came back empty. Off to dinner, play more later. |
Author: | slowtolearn [ Sun Jun 03, 2007 7:09 pm ] |
Post subject: | |
ghede wrote: root@mythtv:/etc/rc5.d# ls Apparently your version created S99lvm. What are the contents of that file? You could probably simply add the mount command to the end of that file and remove the S27mount file...
S10sysklogd S20bootsplash S20mysql S20openbsd-inetd S20webmin S45autofs S89cron S99lvm S11klogd S20lirc S20nvidia-glx S20samba S27mount S50mythtv-backend S90install-nvidia-debian S99rmnologin S20apache2 S20makedev S20nvidia-kernel S20ssh S40dbus S85ntp S99folding@home I don't see that file on my system. Unfortunately, same problem with the S27mount file. But it sounds like my wag about timing might be right. I did a "root@mythtv:/# locate S26lvm" and it came back empty. Off to dinner, play more later. |
Author: | ghede [ Sun Jun 03, 2007 8:36 pm ] |
Post subject: | |
/etc/rc5.d/S99lvm looks like a copy of /etc/init.d/lvm. I don't think I should add those lines to the end. Tell me otherwise if need be. Here is the heading at the top of the script, it's 81 lines big: #!/bin/bash # # lvm This script handles the LVM startup/shutdown # so that LVMs are properly configured and available. # Jim |
Author: | slowtolearn [ Mon Jun 04, 2007 5:09 pm ] |
Post subject: | |
ghede wrote: /etc/rc5.d/S99lvm looks like a copy of /etc/init.d/lvm. I mis-spoke earlier when I said I had trouble mounting LVs on Slackware from fstab, it was actually on my KM R5D1 system that I had the problem. I did not use the create_lvm.sh script - I created my own, which contains the following:
I don't think I should add those lines to the end. Tell me otherwise if need be. Here is the heading at the top of the script, it's 81 lines big: #!/bin/bash # # lvm This script handles the LVM startup/shutdown # so that LVMs are properly configured and available. # Jim Code: #!/bin/sh
vgscan sleep 1 vgchange -a y sleep 1 mount /dev/VG1/LVG1 /VG So this is what I would suggest at this point: 1 - Run update-rc.d -f lvm remove 1a - If /etc/rc5.d/S27mount still exists, remove it 2 - Recreate /etc/rc5.d/S99lvm with the code I referenced above (with your specific device name and mount point) 3 - Reboot |
Author: | ghede [ Mon Jun 04, 2007 9:59 pm ] |
Post subject: | |
I hate to say it, but it didn't work. Webmin shows that it didn't mount. When I try to manually mount it as before, it now says: root@mythtv:/# mount /dev/vg/myth mount: you must specify the filesystem type So I => root@mythtv:/# mount -t ext3 /dev/vg/myth /myth mount: special device /dev/vg/myth does not exist. hmmm. If I understand what happened, I deleted the files symlinked to /init.d/lvm with this: update-rc.d -f lvm remove. The numbered files in /etc/rc5.d are loaded in numerical order. 99's the last to load. Why won't it manually load anymore. Symlinks were removed from rc2.d, and a couple of others. I guess that would be the obvious reason. Here's S99lvm: #!/bin/sh vgscan sleep 1 vgchange -a y sleep 1 mount /dev/vg/myth /myth Edit: I just noticed during a reboot that it gives a permission error for S99lvm. I did all this as root. Maybe I shouldn't have? |
Author: | slowtolearn [ Tue Jun 05, 2007 7:03 am ] |
Post subject: | |
ghede wrote: I hate to say it, but it didn't work. Webmin shows that it didn't mount. When I try to manually mount it as before, it now says: ??? Did you remove the device or try to recreate the LVM? What does ls -la /dev/vg show you?root@mythtv:/# mount /dev/vg/myth mount: you must specify the filesystem type So I => root@mythtv:/# mount -t ext3 /dev/vg/myth /myth mount: special device /dev/vg/myth does not exist. ghede wrote: hmmm. If I understand what happened, I deleted the files symlinked to /init.d/lvm with this: update-rc.d -f lvm remove. Correct, running the update-rc.d command would have removed the SXXlvm files from the /etc/rcX.d directories.The numbered files in /etc/rc5.d are loaded in numerical order. 99's the last to load. Why won't it manually load anymore. Symlinks were removed from rc2.d, and a couple of others. I guess that would be the obvious reason. ghede wrote: Here's S99lvm: That looks fine to me, except that you apparently no longer have a /dev/vg/myth to mount. You may need to go through the create_lvm.sh script again, but be aware that this would overwrite your current S99lvm (probably).#!/bin/sh vgscan sleep 1 vgchange -a y sleep 1 mount /dev/vg/myth /myth ghede wrote: Edit: Did you change the permissions on it to make it executable? Eg: chmod 755 /etc/rc5.d/S99lvm
I just noticed during a reboot that it gives a permission error for S99lvm. I did all this as root. Maybe I shouldn't have? From your previous posts everything was fine, with the exception of mounting the LV from fstab (that problem I believe is simply a timing issue, the LV is not available when mountall is called as mountall is called from /etc/rcS.d). All you are doing with the above S99lvm is A) setting the LV to "available" and B) mounting it into /myth. For some "light" reading (:wink:) and a more in-depth look at LVM2, take a look at http://tldp.org/HOWTO/LVM-HOWTO/ |
Author: | ghede [ Tue Jun 05, 2007 10:53 pm ] |
Post subject: | |
Yes, success! It worked. Thank you so much. I didn't even think about the permissions. I also had to rename the script to S27lvm, as S99lvm was started after the backend (S50mythtv-backend). It mounted, but after the backend was started. I've had the LVM info you linked to printed out for the past couple of weeks trying to solve this ![]() Again, a big thank you to you and all who make this project and this forum what it is. Quite frankly, there's no way I could ever have gotten as far as I have without this. |
Author: | slowtolearn [ Wed Jun 06, 2007 8:44 am ] |
Post subject: | |
ghede wrote: Yes, success! It worked. Thank you so much. No problems, glad to hear you got it workingghede wrote: I didn't even think about the permissions. I also had to rename the script to S27lvm, as S99lvm was started after the backend (S50mythtv-backend). It mounted, but after the backend was started. That would cause a problem wouldn't it? ![]() ghede wrote: I've had the LVM info you linked to printed out for the past couple of weeks trying to solve this "other operating system"?? You mean Solaris? ![]() ![]() ghede wrote: Again, a big thank you to you and all who make this project and this forum what it is. Quite frankly, there's no way I could ever have gotten as far as I have without this. Enjoy!
|
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |