# device-mapper is blocking LVM2

## Exhaust

Hi there,

Tried to emerge --update world today and i got into problems with device-mapper and LVM2.

sadly i unmerged them both then emerged device-mapper again, then tried LVM2 but now i can't emerge LVM2 at all  :Sad: 

this is my emerge attempt:

 *Quote:*   

> 
> 
> portage # emerge --pretend --verbose lvm2
> 
> These are the packages that would be merged, in order:
> ...

 

I've got a little desperate now because if i have a power failure or reboot I can't get to my LVM volumes  :Sad: 

Please, any help would be great.

thanks

/Fredrik

----------

## Exhaust

I'm a bit confused here...is evice-mapper no longer required as a separate package with LVM2? Is the same functions included in LVM2 package now?

If I run "emerge lvm2" it never says it needs the device-mapper package. Is everything ok then?

thanks

/Fredrik

----------

## Mike Hunt

I have sys-fs/lvm2-2.02.49 installed but no device-mapper. Don't seem to need it.   :Cool: 

You probably have device-mapper in your world file unless there is something else (maybe even an older version of lvm) pulling it in.

If you boot your CD and chroot your box, then unmerge device-mapper and emerge lvm2, you should be ok.

Remember to add lvm to rc-update add lvm boot for lvm2.

----------

## Exhaust

thanks for the reply.

Sounds very good that you don't have device mapper and it works.

I unmerged my old device mapper, and my old lvm2. Then i emerged lvm2 again to the newest version sys-fs/lvm2-2.02.49-r1. 

No complaints from the lvm install, and no dependencies to device-mapper reported  :Smile: 

I was afraid it still needs the device-mapper, but something was wrong as it wasn't complaining about it missing.

I guess your reply helps me to collect the courage to try and reboot without the device-mapper tomorrow, to see if it's still working  :Smile:  If no one says otherwise until then that is :p

I already have lvm added to boot from my previous version.

thanks

/Fredrik

----------

## cach0rr0

hrmmm

```

laptop01 ~ # equery belongs device-mapper

[ Searching for file(s) device-mapper in *... ]

sys-kernel/gentoo-sources-2.6.29-r5 (/usr/src/linux-2.6.29-gentoo-r5/Documentation/device-mapper)

sys-fs/device-mapper-1.02.24-r1 (/etc/init.d/device-mapper)

sys-fs/device-mapper-1.02.24-r1 (/etc/conf.d/device-mapper)

```

```

laptop01 ~ # equery depends device-mapper

[ Searching for packages depending on device-mapper... ]

sys-fs/cryptsetup-1.0.6-r2 (>=sys-fs/device-mapper-1.00.07-r1)

sys-fs/lvm2-2.02.36 (>=sys-fs/device-mapper-1.02.24)

```

maybe you can figure out what's up with equery provided by gentoolkit package?

----------

## cach0rr0

wait

your USE flags have lvm1

do

```

USE="-lvm1 lvm2" emerge -pv lvm2

```

EDIT:

If i were to hazard a guess, I'd say your device-mapper being built with USE="lvm1" is blocking the merge ov LVM2

I am no export on portage, so take that with a grain of salt, but it seems to make sense in my weird little world. 

Do this:

```

quickpkg device-mapper   

```

(for backup purposes)

edit your make.conf and remove lvm1 if it's in there

then

```

emerge -C device-mapper

echo "sys-fs/device-mapper lvm2" >> /etc/portage/package.use

emerge device-mapper lvm2

```

Note that you currently have LVM running without the LVM2 package installed, yes? So your LVM is done differently. 

I would look around and see if you can dig up some doc on what's required to move to LVM2 from LVM1

What i posted above may be sufficient, but as LVM is fairly new to me too (though I love it!) I cannot guarantee my advice won't break things  :Sad: 

----------

## Exhaust

I actually already run LVM2 on the machine, I'm only trying to upgrade to a newer version. My previous install of device-mapper and LVM2 was done with the same USE flags as now.

By the looks of things they have included a device-mapper function in the newer LVM2 packages!?

LVM2 package no longer asks for, or tries to install the device-mapper package.

I have unmerged both my old device-mapper and LVM2, then emerged the newest LVM2 package. That works fine and no errors or dependency problems.

It just makes me confused that I can't find any info on that LVM2 no longer needs the device-mapper package.

Another ting that bothers me is that if a system with LVM2 no longer can have the device-mapper installed. Then what if i have other things that need the device-mapper? I don't but maybe others do.

I have not yet tried to reboot my system to se if LVM still works.

thanks

/Fredrik

----------

## Exhaust

I "think" the lvm USE flag is there only for backward compatibility. To make lvm2 to handle old lvm volumes!?

Thanks

/Fredrik

----------

## depontius

 *Mike Hunt wrote:*   

> Remember to add lvm to rc-update add lvm boot for lvm2.

 

Can you explain a little further...

I've been running lvm2 for years, and never added it to boot.  In fact, I installed a machine last week and never added lvm to boot, and was a little surprised to see the initscript there, but the system was running and booting just fine.  It's worth mentioning that on this particular machine, /, /usr, and /var are on regular partitions, but /home and /media are in lvm2.  All mount just fine.

Perhaps it's simplest to ask if I'm really using lvm2, or just lvm?  I first set this system up using Gentoo HowTo's several years ago, and I thought it was lvm2.

How do I tell?

Does it matter?

----------

## cach0rr0

 *depontius wrote:*   

>  *Mike Hunt wrote:*   Remember to add lvm to rc-update add lvm boot for lvm2. 
> 
> Can you explain a little further...
> 
> I've been running lvm2 for years, and never added it to boot.  In fact, I installed a machine last week and never added lvm to boot, and was a little surprised to see the initscript there, but the system was running and booting just fine.  It's worth mentioning that on this particular machine, /, /usr, and /var are on regular partitions, but /home and /media are in lvm2.  All mount just fine.
> ...

 

as I understand it, that depends on what revision of baselayout you're currently on 

for baselayout 1.x you don't need to add it to boot

for baselayout 2.x you do

(check the LVM2 guide on the doc pages)

----------

## cach0rr0

 *Exhaust wrote:*   

> I actually already run LVM2 on the machine, I'm only trying to upgrade to a newer version. My previous install of device-mapper and LVM2 was done with the same USE flags as now.
> 
> 

 

 *Quote:*   

> 
> 
> ebuild N ] sys-fs/lvm2-2.02.49-r1 USE="lvm1 readline static -clvm (-cman) (-selinux)" 0 kB 
> 
> 

 

Note the "N" - this is a brand new package that has never before been installed

If it were an upgrade, it would have been marked with "U"

----------

## Exhaust

 *Quote:*   

> 
> 
> Note the "N" - this is a brand new package that has never before been installed
> 
> If it were an upgrade, it would have been marked with "U"

 

Yes but at the time I issued that command I had already unmerged both device-mapper and lvm2.

that was my attempt to install it again.

My first upgrade attempt was similar, but i guess it said U when i did it the first time.

thanks

/Fredrik[/quote]

----------

## cach0rr0

 *Exhaust wrote:*   

>  *Quote:*   
> 
> Note the "N" - this is a brand new package that has never before been installed
> 
> If it were an upgrade, it would have been marked with "U" 
> ...

 [/quote]

ahhh, ok, that makes more sense now. 

I'll think on it some more and get back to you, as I'm sure some others will too

----------

## Mike Hunt

I have no lvm* USE flag manually set anywhere, so that lvm1 flag must be set by portage.

```
emerge -pv lvm2 device-mapper

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] sys-fs/lvm2-2.02.49-r1  USE="lvm1 readline static -clvm (-cman) (-selinux)" 0 kB

[ebuild  N    ] sys-fs/device-mapper-1.02.28  USE="(-selinux)" 199 kB
```

 *emerge wrote:*   

> * Messages for package sys-fs/lvm2-2.02.49-r1:
> 
>  * Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with
> 
>  * their static versions. If you need the static binaries,
> ...

 

```
# df -h

Filesystem            Size  Used Avail Use% Mounted on

rootfs                 20G  4.8G   15G  25% /

/dev/root              20G  4.8G   15G  25% /

rc-svcdir             1.0M   96K  928K  10% /lib/rc/init.d

udev                   10M   68K   10M   1% /dev

shm                   442M  4.0K  442M   1% /dev/shm

/dev/mapper/vg-portage     2.0G  530M  1.4G  28% /usr/portage

/dev/mapper/vg-distfiles   4.0G  2.1G  1.8G  54% /usr/portage/distfiles

/dev/mapper/vg-home        2.7G  974M  1.8G  36% /home

/dev/mapper/vg-tmp         2.0G  3.1M  1.9G   1% /tmp

/dev/mapper/vg-vartmp      6.0G  333M  5.3G   6% /var/tmp
```

Works for me.   :Very Happy:   :Cool:   :Wink: 

----------

## Exhaust

Yes The USE flag must be set by default because I haven't changed anything either.

How strange that it works for you to install device-mapper AND lvm2   :Confused: 

seems to be the same versions too.

I'm really confused??

thanks

/Fredrik

----------

## Exhaust

Anyone knows if this could be a problem caused by some error in my ebuild database? 

Could 

```
emerge --depclean
```

resolve these kind of issues?

thanks

/Fredrik

----------

## Mike Hunt

 *Exhaust wrote:*   

> Yes The USE flag must be set by default because I haven't changed anything either.
> 
> How strange that it works for you to install device-mapper AND lvm2  
> 
> seems to be the same versions too.
> ...

 

No, no, I don't have lvm2 and device-mapper installed.  This shows that lvm2 is installed but device-mapper is not installed.

ebuild   R = already installed

ebuild  N  = not installed

```
emerge -pv lvm2 device-mapper

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] sys-fs/lvm2-2.02.49-r1  USE="lvm1 readline static -clvm (-cman) (-selinux)" 0 kB

[ebuild  N    ] sys-fs/device-mapper-1.02.28  USE="(-selinux)" 199 kB
```

Sorry if I wasn't clear.   :Smile: 

----------

## Exhaust

Ohh yes I saw that now  :Smile:  I wasn't looking hard enough.

But that means you are running LVM2 without the use och device-mapper wich could be good news for me then. ?

It means there are a possibility my LVM2 will still work.

BUT I'm still confused that you don't get the same block as me   :Confused: 

I still get this

```

# emerge --pretend --verbose device-mapper                  

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild  N    ] sys-fs/device-mapper-1.02.28  USE="(-selinux)" 0 kB

[blocks B     ] sys-fs/device-mapper ("sys-fs/device-mapper" is blocking sys-fs/lvm2-2.02.49-r1)

Total: 1 package (1 new), Size of downloads: 0 kB

Conflict: 1 block (1 unsatisfied)

 * Error: The above package list contains packages which cannot be

 * installed at the same time on the same system.

  ('ebuild', '/', 'sys-fs/device-mapper-1.02.28', 'merge') pulled in by

    device-mapper

  ('installed', '/', 'sys-fs/lvm2-2.02.49-r1', 'nomerge') pulled in by

    sys-fs/lvm2 required by world

For more information about Blocked Packages, please refer to the following

section of the Gentoo Linux x86 Handbook (architecture is irrelevant):

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#blocked

```

thanks

/Fredrik

----------

## Mike Hunt

Oh, sure I get that too, but since I don't have it or need it it's a non-issue.   :Smile: 

```
# emerge --pretend --verbose device-mapper

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild  N    ] sys-fs/device-mapper-1.02.28  USE="(-selinux)" 199 kB

[blocks B     ] sys-fs/device-mapper ("sys-fs/device-mapper" is blocking sys-fs/lvm2-2.02.49-r1)

Total: 1 package (1 new), Size of downloads: 199 kB

Conflict: 1 block (1 unsatisfied)

 * Error: The above package list contains packages which cannot be

 * installed at the same time on the same system.

  ('ebuild', '/', 'sys-fs/device-mapper-1.02.28', 'merge') pulled in by

    device-mapper

  ('installed', '/', 'sys-fs/lvm2-2.02.49-r1', 'nomerge') pulled in by

    sys-fs/lvm2 required by @world

For more information about Blocked Packages, please refer to the following

section of the Gentoo Linux x86 Handbook (architecture is irrelevant):

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#blocked

```

Sorry again if I wasn't clear enough.   :Very Happy: 

----------

## cach0rr0

this should probably be moved to "Portage and Programming" 

mods? anyone? I don't think this is getting enough of the right kind of visibility here

----------

## Exhaust

Yes I thought about putting it there too, but I found 1 or 2 old lvm/device-mapper threads in this category thats why i placed it here.

Please move it if thats more appropriate  :Smile: 

Thanks

/Fredrik

----------

## Exhaust

 *Mike Hunt wrote:*   

> Oh, sure I get that too, but since I don't have it or need it it's a non-issue.  
> 
> ```
> # emerge --pretend --verbose device-mapper
> 
> ...

 

Oh great, so you think I should dare to reboot now and hope it still works?   :Laughing: 

----------

## cach0rr0

 *Exhaust wrote:*   

> Yes I thought about putting it there too, but I found 1 or 2 old lvm/device-mapper threads in this category thats why i placed it here.
> 
> Please move it if thats more appropriate 
> 
> Thanks
> ...

 

no worries, I don't think any of us mind. 

I just want to make sure your issue gets attention from the right people, and with something as critical as this I don't think we can afford to *guess*. Best to not make any changes, and wait on somebody who *knows* what is correct - I personally do not, and am making guesses (marginally-educated ones at that)

----------

## cach0rr0

actually

https://bugs.gentoo.org/show_bug.cgi?id=265599

i just googled 'device mapper blocking lvm'

----------

## Mike Hunt

 *Exhaust wrote:*   

> Oh great, so you think I should dare to reboot now and hope it still works?  

 

Sure, if mine works, there is no reason yours shouldn't, it's not a guess it is a proven fact. 

And now thanks to our cach0rr0's alacrity we have a confirmation that "with lvm2 2.02.45, the device-mapper library is built-in instead of supplied by sys-fs/device-mapper".

So by all means go ahead and reboot.   :Very Happy: 

----------

## cach0rr0

 *Mike Hunt wrote:*   

> 
> 
> So by all means go ahead and reboot.  

 

Should he go ahead and reboot, or should he first emerge -C device-mapper && emerge lvm2 ?

my head is spinning at this stage - am lost

----------

## Mike Hunt

device-mapper is no longer required by lvm2 >= 2.02.45.  It is included in lvm2.

```
emerge lvm2
```

Then if emerge -s baselayout shows version 2.*

```
rc-update add lvm boot 
```

Otherwise it should be automatically added to the Runlevel: needed

And then reboot.   :Wink: Last edited by Mike Hunt on Mon Jul 27, 2009 6:53 pm; edited 2 times in total

----------

## cach0rr0

 *Mike Hunt wrote:*   

> device-mapper is no longer required by lvm2 >= 2.02.45.  It is included in lvm2.
> 
> ```
> emerge lvm2
> ```
> ...

 

yeah, that's where I'm lost

I don't know if he's already unmerged device-mapper

He needs to unmerge it before it will let him emerge lvm2

so emerge -C device-mapper && emerge lvm2

(if he hasn't already unmerged device-mapper)

----------

## Mike Hunt

From page 1 - 4th post

 *Exhaust wrote:*   

> Sounds very good that you don't have device mapper and it works.
> 
> I unmerged my old device mapper, and my old lvm2. Then i emerged lvm2 again to the newest version sys-fs/lvm2-2.02.49-r1.
> 
> No complaints from the lvm install, and no dependencies to device-mapper reported 

 

 :Very Happy: 

----------

## cach0rr0

 *Mike Hunt wrote:*   

> From page 1 - 4th post
> 
>  *Exhaust wrote:*   Sounds very good that you don't have device mapper and it works.
> 
> I unmerged my old device mapper, and my old lvm2. Then i emerged lvm2 again to the newest version sys-fs/lvm2-2.02.49-r1.
> ...

 

cool. I'm blind!

----------

## Mike Hunt

 *cach0rr0 wrote:*   

> cool. I'm blind!

 

Happens to all of us.  Time for a coffee.  :Smile: 

----------

## Exhaust

 *cach0rr0 wrote:*   

> actually
> 
> https://bugs.gentoo.org/show_bug.cgi?id=265599
> 
> i just googled 'device mapper blocking lvm'

 

Ohh man you found the stuff I was looking for, thanks alot  :Smile: 

I have googled and googled and i didn't find it. Nice with helpful people  :Smile: 

I'm going to try a reboot soon, I have to wait for some compiling to finish first.

I will tell you how it turned out.

Thanks

/Fredrik

----------

## cach0rr0

make your backups, and take advantage of quickpkg

if things fail miserably, quickpkg can save your arse. 

best of luck, let us know how things turn out.

----------

## Mike Hunt

I doubt if anything could fail miserably, at worse the volume group wont be initialized, and the logical volumes won't be mounted. It's at most a minor nuisance.   :Very Happy: 

You can Display volume groups and logical volumes

```
vgs 

lvs
```

 *Gentoo LVM2 installation wrote:*   

> Continuing After a Reboot
> 
> If you have interrupted the Gentoo installation at one point and want to continue, you need to create the volume device nodes first:
> 
> Code Listing 3.1: Reactivating the volumes
> ...

 

----------

## Exhaust

Hey, thanks everyone for all the help.

It works flawlessly  :Smile: 

Thanks

/Fredrik

----------

## Mike Hunt

Awesome,   :Very Happy: 

----------

## Exhaust

Hmm, now i only have one more issue to deal with. wich I have had a feeling could have with lvm and/or device-mapper to do....

guess I don't need to adress that in this thread but i will try to ask nontheless  :Razz: 

My FTP is mounted on the LVM volume, wich is about 3TB in size spanning 4-5 physical disks. Sometimes, not always when i create a directory via FTP the system freezes for like a minute or two...nothing happens. then it starts working again.

even the console freezes when this happens. 

The problem didn't go away with this update  :Sad: 

the only thing not updated now is the kernel and the hardware. 

Any thoughts?

The FTP server is glftpd btw.

I guess i will open a new thread about this problem elsewhere  :Smile: 

**edit** it's 3TB not 3GB as previously stated  :Embarassed: 

thanks

/FredrikLast edited by Exhaust on Mon Jul 27, 2009 11:37 pm; edited 1 time in total

----------

## cach0rr0

what file system is it, and how full is the partition?

Not the total disk itself, I mean how much of that 3GB is actually in use? 

The more full the file system, in general the worse the write performance you're going to see - this includes directory creation. 

Why 3GB? Is this to limit how much space the FTP users can use? If so I'd opt for setting a per-user disk quota, rather than keeping the volume so small. 

If all else fails, strace it - stop the daemon through the init script, then  sudo -u <ftpdaemonacct> strace /path/to/binary -somestartupargument -anotherstartupargument -etc 

when all other options have run out, strace is your best friend  :Smile: 

----------

## Exhaust

 *cach0rr0 wrote:*   

> what file system is it, and how full is the partition?
> 
> Not the total disk itself, I mean how much of that 3GB is actually in use? 
> 
> The more full the file system, in general the worse the write performance you're going to see - this includes directory creation. 
> ...

 

Well it's actually VERY full, but i belive the problem was there even when it wasn't that full.

It's about 99% full  :Sad: 

SORRY, I meant 3TB not GB   :Embarassed:  and that is all disk i have available at the moment.

It's ext3 filesystem on the LVM volume and ext2 on the system.

I found out that only the LVM volume freezes during creation of directories, NEVER files, I can still use the console on the system partition (Do ls -la and stuff) If I try to ls -la on the LVM when this happens the console freezes until the FTP is done creating the dir.

It's not a really big problem, but i get aggrivated when it happens  :Razz: 

thanks

/Fredrik

----------

## cach0rr0

haha...i was wondering if you meant 3TB

I don't really have any ideas then - performance degradation as the volume becomes full is normal, but I haven't a clue if that's part of the cause; and doubt it since as you say, the issue remained when it was less full.

----------

## Exhaust

I will try to find a place to put a new thread about this. Maybe someone has a clue.

I have to do some more testing and see if it's only glftpd who triggers the problem. It's really weird it only affects directories as far as i have seen. i can upload hundreds of files with good speed (20-30MB/s) then when it comes to creating a dir it freezes for a while then continues with the same high speed as before.

glftpd is a rather server old program and not maintained anymore. And i think the install procedure is a bit unconventional. maybe it's a new system/old glftpd issue. though i never heard or found anyone else with the same problem.

thanks

/Fredrik

----------

## Mike Hunt

 *Exhaust wrote:*   

> I will try to find a place to put a new thread about this. Maybe someone has a clue.

 

I think the Networking & Security forum is the right one.   :Smile: 

----------

## Exhaust

Opened a new thread about the slow dir creation problem 

[url]

https://forums.gentoo.org/viewtopic-t-784787.html

[/url]

----------

