Skip to contentSkip to conversation

How to build LVM2 tools for 2.6?

linux-lvm Charles Martin 6 participants 7 messages Dec 22, 2003 – Dec 23, 2003

lore
Share & tools
lore
#0 lore raw

I'm running Linux 2.6.0 on a system that
started life as Red Hat 9. I want to install
the LVM2 tools (v2.0.8) so that I can resurrect
my LVM disks.

When I attempt to build the tools (./configure; make install), device/dev-io.c fails to compile, due to a missing definition of BLKGETSIZE64. Clearly, the compile needs to be looking at the headers in the 2.6.0 tree.

I've seen plenty of mention of people running LVM2 successfully with the 2.6 test kernels. Can anyone tell me how to build the tools?

Thanks,
Charlie

#1 lore raw

[linux-lvm] umount returns device is busy

I've been using LVM now since sometime this past summer and everything has worked great and as advertised, until I tried to unmount a logical volume. And this happens on both RedHat 9 and ES_3.

I had occasion the other day to unmount one of the mounted raid arrays in order to upgrade some firmware. When I tried to do an unmount command, I got "device is busy". Ok, I'm cd'd there from one of my windows or something, so I make sure all open terminal windows are *not* cd'd there. Redo the umount command with same result. Weird, something's got a file open. So, I did an lsof command and grep for the device (/dev/VG1/LV1). Nothing. I try greping for the mount name (/scratch/cdf). Nothing. It will not let me unmount the logical volume.

The system in question is running RedHat 9 w/kernel 2.4.20-24.9smp with RedHat's lvm-1.0.3-12. I just so happened to have built another system using RedHat's ES_3 w/kernel 2.4.21-4.0.1.ELsmp and their lvm-1.0.3-15, so I thought I'd try it there. Built an identical logical volume, mounted it, tested it (works fine), tried to umount the filesystem with identical results: device is busy. Checked again using lsof. Nothing open on the mounted filesystem.

I went checking back thru about 4 months of this list and saw (apparently) that no one else has this problem. At this point I'm a bit baffled why the umount command isn't working. I've also seen nothing that might address this in the LVM-HOWTO. Then again, I could have missed it.

Ideas?

Thanks!

Signature · 6 lines
P. Larry Nelson (217-244-9855) | Systems/Network Administrator
461 Loomis Lab                 | U of I, CITES Departmental Services
1110 W. Green St., Urbana, IL  | Consultant to: High Energy Physics Group
MailTo:[email protected]        | http://www.uiuc.edu/ph/www/lnelson
-------------------------------------------------------------------------
 "Information without accountability is just noise."  - P.L. Nelson
#2 lore raw

Re: [linux-lvm] umount returns device is busy

Quoted 23 lines · P. Larry Nelson

I've been using LVM now since sometime this past summer and everything has worked great and as advertised, until I tried to unmount a logical volume. And this happens on both RedHat 9 and ES_3.

I had occasion the other day to unmount one of the mounted raid arrays in order to upgrade some firmware. When I tried to do an unmount command, I got "device is busy". Ok, I'm cd'd there from one of my windows or something, so I make sure all open terminal windows are *not* cd'd there. Redo the umount command with same result. Weird, something's got a file open. So, I did an lsof command and grep for the device (/dev/VG1/LV1). Nothing. I try greping for the mount name (/scratch/cdf). Nothing. It will not let me unmount the logical volume.

The system in question is running RedHat 9 w/kernel 2.4.20-24.9smp with RedHat's lvm-1.0.3-12. I just so happened to have built another system using RedHat's ES_3 w/kernel 2.4.21-4.0.1.ELsmp and their lvm-1.0.3-15, so I thought I'd try it there. Built an identical logical volume, mounted it, tested it (works fine), tried to umount the filesystem with identical results: device is busy. Checked again using lsof. Nothing open on the mounted filesystem.

Quoted 7 lines

I went checking back thru about 4 months of this list and saw (apparently) that no one else has this problem. At this point I'm a bit baffled why the umount command isn't working. I've also seen nothing that might address this in the LVM-HOWTO. Then again, I could have missed it.

Ideas?

maybe some kernel service is holding a reference to that device, nfs or samba server comes to mind, just try to disable them one after the other and see if umount will work ...

HTH,
Herbert

Quoted 15 lines

Thanks!

Signature · 12 lines
P. Larry Nelson (217-244-9855) | Systems/Network Administrator
461 Loomis Lab                 | U of I, CITES Departmental Services
1110 W. Green St., Urbana, IL  | Consultant to: High Energy Physics Group
MailTo:[email protected]        | http://www.uiuc.edu/ph/www/lnelson
-------------------------------------------------------------------------
 "Information without accountability is just noise."  - P.L. Nelson

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
#3 lore raw

Re: [linux-lvm] umount returns device is busy

Quoted 31 lines · P. Larry Nelson
Quoted 29 lines

I've been using LVM now since sometime this past summer and everything has worked great and as advertised, until I tried to unmount a logical volume. And this happens on both RedHat 9 and ES_3.

I had occasion the other day to unmount one of the mounted raid arrays in order to upgrade some firmware. When I tried to do an unmount command, I got "device is busy". Ok, I'm cd'd there from one of my windows or something, so I make sure all open terminal windows are *not* cd'd there. Redo the umount command with same result. Weird, something's got a file open. So, I did an lsof command and grep for the device (/dev/VG1/LV1). Nothing. I try greping for the mount name (/scratch/cdf). Nothing. It will not let me unmount the logical volume.

The system in question is running RedHat 9 w/kernel 2.4.20-24.9smp with RedHat's lvm-1.0.3-12. I just so happened to have built another system using RedHat's ES_3 w/kernel 2.4.21-4.0.1.ELsmp and their lvm-1.0.3-15, so I thought I'd try it there. Built an identical logical volume, mounted it, tested it (works fine), tried to umount the filesystem with identical results: device is busy. Checked again using lsof. Nothing open on the mounted filesystem.

I went checking back thru about 4 months of this list and saw (apparently) that no one else has this problem. At this point I'm a bit baffled why the umount command isn't working. I've also seen nothing that might address this in the LVM-HOWTO. Then again, I could have missed it.

Quoted 6 lines
Quoted 1 line

Ideas?

maybe some kernel service is holding a reference to that device, nfs or samba server comes to mind, just try to disable them one after the other and see if umount will work ...

In my opinion this is a severe mis-feature (aka: bug) in the Linux kernels. In some occasions it is impossible to kill an application when unmounting a filesystem. This leads to problems with shutting down the system cleanly. For example a device might have been temporary offline when samba tried to access it. The samba thread locks indefinitely and it is impossible to kill it and thus also impossible to unmount the filesystem.

Not sure if LVM guys can do anything about this though. =) Perhaps you can push kernel developers to make it easier to recover from these kinds of problems?

Quoted 2 lines

HTH,
Herbert

#6 lore raw
In reply to Charles Martin
Quoted 10 lines · Charles Martin

I'm running Linux 2.6.0 on a system that
started life as Red Hat 9. I want to install
the LVM2 tools (v2.0.8) so that I can resurrect
my LVM disks.

When I attempt to build the tools (./configure; make install), device/dev-io.c fails to compile, due to a missing definition of BLKGETSIZE64. Clearly, the compile needs to be looking at the headers in the 2.6.0 tree.

try this patch i stole from fedora :)
or use their rpm
L.

lib/device/dev-io.c renamed from lib/device/dev-io.c.blksize64 +0 -0
@@ -23,6 +23,9 @@
#  undef WUNTRACED		/* Avoid redefinition */
#  include <linux/fs.h>		/* For block ioctl definitions */
#  define BLKSIZE_SHIFT SECTOR_SHIFT

+#ifndef BLKGETSIZE64
+# define BLKGETSIZE64 _IOR(0x12,114,size_t)
+#endif /* BLKGETSIZE64 */
#else
# include <sys/disk.h>
# define BLKBSZGET DKIOCGETBLOCKSIZE

Signature · 6 lines
Luca Berra -- [email protected]
       Communication Media & Services S.r.l.
/"\
\ /     ASCII RIBBON CAMPAIGN
 X        AGAINST HTML MAIL
/ \
#4 lore raw

Re: [linux-lvm] umount returns device is busy

In reply to Spam
Quoted 47 lines · On Tue, 23 Dec 2003 01:06:08 +0100 Spam <[email protected]> wrote:
Quoted 32 lines · P. Larry Nelson
Quoted 15 lines

I've been using LVM now since sometime this past summer and everything has worked great and as advertised, until I tried to unmount a logical volume. And this happens on both RedHat 9 and ES_3.

I had occasion the other day to unmount one of the mounted raid arrays in order to upgrade some firmware. When I tried to do an unmount command, I got "device is busy". Ok, I'm cd'd there from one of my windows or something, so I make sure all open terminal windows are *not* cd'd there. Redo the umount command with same result. Weird, something's got a file open. So, I did an lsof command and grep for the device (/dev/VG1/LV1). Nothing. I try greping for the mount name (/scratch/cdf). Nothing. It will not let me unmount the logical volume.

Quoted 4 lines

The system in question is running RedHat 9 w/kernel 2.4.20-24.9smp with RedHat's lvm-1.0.3-12. I just so happened to have built another system using RedHat's ES_3 w/kernel 2.4.21-4.0.1.ELsmp and their lvm-1.0.3-15, so I thought I'd try it there. Built an

identical> logical volume, mounted it, tested it (works fine), tried to umount> the filesystem with identical results: device is busy. Checked> again using lsof. Nothing open on the mounted filesystem.

Quoted 7 lines

I went checking back thru about 4 months of this list and saw (apparently) that no one else has this problem. At this point I'm a bit baffled why the umount command isn't working. I've also seen nothing that might address this in the LVM-HOWTO. Then again, I could have missed it.

Quoted 6 lines
Quoted 1 line

Ideas?

maybe some kernel service is holding a reference to that device, nfs or samba server comes to mind, just try to disable them one after the other and see if umount will work ...

In my opinion this is a severe mis-feature (aka: bug) in the Linux kernels. In some occasions it is impossible to kill an application when unmounting a filesystem. This leads to problems with shutting down the system cleanly. For example a device might have been temporary offline when samba tried to access it. The samba thread locks indefinitely and it is impossible to kill it and thus also impossible to unmount the filesystem.

Quoted 4 lines

Not sure if LVM guys can do anything about this though. =) Perhaps you can push kernel developers to make it easier to recover from these kinds of problems?

Have you tried "fuser -v -m" (see fuser(1)). I think "umount -l" already serves the your case of unmounting a filesystem where kernel thinks it's busy but it isn't.

Bye
Frank Benkstein.

#5 lore raw

Re: [linux-lvm] umount returns device is busy

In reply to Herbert Poetzl
Quoted 33 lines · Herbert Poetzl
Quoted 23 lines · P. Larry Nelson

I've been using LVM now since sometime this past summer and everything has worked great and as advertised, until I tried to unmount a logical volume. And this happens on both RedHat 9 and ES_3.

I had occasion the other day to unmount one of the mounted raid arrays in order to upgrade some firmware. When I tried to do an unmount command, I got "device is busy". Ok, I'm cd'd there from one of my windows or something, so I make sure all open terminal windows are *not* cd'd there. Redo the umount command with same result. Weird, something's got a file open. So, I did an lsof command and grep for the device (/dev/VG1/LV1). Nothing. I try greping for the mount name (/scratch/cdf). Nothing. It will not let me unmount the logical volume.

The system in question is running RedHat 9 w/kernel 2.4.20-24.9smp with RedHat's lvm-1.0.3-12. I just so happened to have built another system using RedHat's ES_3 w/kernel 2.4.21-4.0.1.ELsmp and their lvm-1.0.3-15, so I thought I'd try it there. Built an identical logical volume, mounted it, tested it (works fine), tried to umount the filesystem with identical results: device is busy. Checked again using lsof. Nothing open on the mounted filesystem.

Quoted 7 lines

I went checking back thru about 4 months of this list and saw (apparently) that no one else has this problem. At this point I'm a bit baffled why the umount command isn't working. I've also seen nothing that might address this in the LVM-HOWTO. Then again, I could have missed it.

Ideas?

Quoted 7 lines

maybe some kernel service is holding a reference to that device, nfs or samba server comes to mind, just try to disable them one after the other and see if umount will work ...

HTH,
Herbert

That was it. The nfs daemon had it tied up (we're not running samba). I tried 'umount -f' and 'umount -l' without success. Frank Benkstein suggested using 'fuser -v -m /scratch/cdf' and that returned nothing as well. But when I stopped the nfs daemon, it unmounted just fine.

On a hunch, further testing shows that it's not necessary to actually stop the nfs daemon, just remove the entry from /etc/exports for the filesystem you wish to unmount and run 'exportfs -r'. That way, apparently, the nfs daemon no longer cares what you do with the filesystem. Then, the umount command works just fine. But it is interesting that fuser doesn't indicate that nfsd has a hold on the mounted filesystem.

Thanks to all!
- Larry

Signature · 6 lines
P. Larry Nelson (217-244-9855) | Systems/Network Administrator
461 Loomis Lab                 | U of I, CITES Departmental Services
1110 W. Green St., Urbana, IL  | Consultant to: High Energy Physics Group
MailTo:[email protected]        | http://www.uiuc.edu/ph/www/lnelson
-------------------------------------------------------------------------
 "Information without accountability is just noise."  - P.L. Nelson