Mount cached lvm2 volume from rescue system











up vote
0
down vote

favorite












I have the following setup:



root@system:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 30G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 977M 0 part
│ └─md0 9:0 0 976,4M 0 raid1 /boot
└─sda3 8:3 0 29G 0 part
└─md1 9:1 0 29G 0 raid1
└─vg00-root_corig 253:3 0 29G 0 lvm
└─vg00-root 253:0 0 29G 0 lvm /
sdb 8:16 0 8G 0 disk
├─vg00-cache_cdata 253:1 0 8G 0 lvm
│ └─vg00-root 253:0 0 29G 0 lvm /
└─vg00-cache_cmeta 253:2 0 32M 0 lvm
└─vg00-root 253:0 0 29G 0 lvm /
sr0 11:0 1 1024M 0 rom
root@system:~# lvs -a
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
[cache] vg00 Cwi---C--- 7,93g 0,51 3,22 0,00
[cache_cdata] vg00 Cwi-ao---- 7,93g
[cache_cmeta] vg00 ewi-ao---- 32,00m
[lvol0_pmspare] vg00 ewi------- 32,00m
root vg00 Cwi-aoC--- 29,02g [cache] [root_corig] 0,51 3,22 0,00
[root_corig] vg00 owi-aoC--- 29,02g


As you can see I have a volume group vg00 that spans across 2 physical devices sda(sda3) and sdb. The lv root is placed on a raid1 md1. This raid device only has one disk. This doesn't make much sense for production use. Please ignore that for the moment. It does in other setups and is not relevant here.



The lv root is using a writethrough cache using dm-cache.



My problem: E.g. in case the system doesn't boot for whatever reason I need to be able to mount my lv root which contains the root fs to recover files or fix a broken installation. To do that I boot into a rescue evoirment and assemble the raid1:



root@rescue:/# mdadm --assemble md1 /dev/sda3
mdadm: /dev/md/md1 has been started with 1 drive.


However I cannot activate the lv root:



root@rescue:/# lvchange -a y vg00/root
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
/dev/mapper/vg00-cache_cmeta: open failed: No such file or directory


vgchange -a y vg00 produces the same result.



When trying often enough the required lvs cache_cmeta and cache_cdata sometimes become active (lvs -a). When that's the case I can create the device mapper files using vgmknodes and run lvchange -a y vg00/root or vgchange -a y to activate root and mount the device as usual. However this is not reliable.



I cannot activate the cache lvs manually:



root@rescue:/# lvchange -a y vg00/cache_cmeta
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
Unable to change internal LV vg00/cache_cmeta directly.


Question: What is the correct way to activate a cached lv?



I can uncache the lv using lvconcert --uncache vg00/root which works reliably, however I'm looking for a reliable way to mount the root lv without uncaching it first.










share|improve this question
























  • From this (and similar data I was able to find by searching), it follows that you should either start lvmedad, which is a daemon, before trying to carry other LVM operations, or disable it in the LVM config and update initramfs: some LVM management operations will become slower but they won't depend on that daemon being active.
    – kostix
    Nov 19 at 14:58










  • lvmetad is not available in rescue. It should not influence operation. I can try disabling it via config anyway and see what happens, but I doubt it'll make a difference. I can't update my initramfs without access to my rootfs.
    – K.A.B.
    Nov 20 at 15:44















up vote
0
down vote

favorite












I have the following setup:



root@system:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 30G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 977M 0 part
│ └─md0 9:0 0 976,4M 0 raid1 /boot
└─sda3 8:3 0 29G 0 part
└─md1 9:1 0 29G 0 raid1
└─vg00-root_corig 253:3 0 29G 0 lvm
└─vg00-root 253:0 0 29G 0 lvm /
sdb 8:16 0 8G 0 disk
├─vg00-cache_cdata 253:1 0 8G 0 lvm
│ └─vg00-root 253:0 0 29G 0 lvm /
└─vg00-cache_cmeta 253:2 0 32M 0 lvm
└─vg00-root 253:0 0 29G 0 lvm /
sr0 11:0 1 1024M 0 rom
root@system:~# lvs -a
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
[cache] vg00 Cwi---C--- 7,93g 0,51 3,22 0,00
[cache_cdata] vg00 Cwi-ao---- 7,93g
[cache_cmeta] vg00 ewi-ao---- 32,00m
[lvol0_pmspare] vg00 ewi------- 32,00m
root vg00 Cwi-aoC--- 29,02g [cache] [root_corig] 0,51 3,22 0,00
[root_corig] vg00 owi-aoC--- 29,02g


As you can see I have a volume group vg00 that spans across 2 physical devices sda(sda3) and sdb. The lv root is placed on a raid1 md1. This raid device only has one disk. This doesn't make much sense for production use. Please ignore that for the moment. It does in other setups and is not relevant here.



The lv root is using a writethrough cache using dm-cache.



My problem: E.g. in case the system doesn't boot for whatever reason I need to be able to mount my lv root which contains the root fs to recover files or fix a broken installation. To do that I boot into a rescue evoirment and assemble the raid1:



root@rescue:/# mdadm --assemble md1 /dev/sda3
mdadm: /dev/md/md1 has been started with 1 drive.


However I cannot activate the lv root:



root@rescue:/# lvchange -a y vg00/root
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
/dev/mapper/vg00-cache_cmeta: open failed: No such file or directory


vgchange -a y vg00 produces the same result.



When trying often enough the required lvs cache_cmeta and cache_cdata sometimes become active (lvs -a). When that's the case I can create the device mapper files using vgmknodes and run lvchange -a y vg00/root or vgchange -a y to activate root and mount the device as usual. However this is not reliable.



I cannot activate the cache lvs manually:



root@rescue:/# lvchange -a y vg00/cache_cmeta
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
Unable to change internal LV vg00/cache_cmeta directly.


Question: What is the correct way to activate a cached lv?



I can uncache the lv using lvconcert --uncache vg00/root which works reliably, however I'm looking for a reliable way to mount the root lv without uncaching it first.










share|improve this question
























  • From this (and similar data I was able to find by searching), it follows that you should either start lvmedad, which is a daemon, before trying to carry other LVM operations, or disable it in the LVM config and update initramfs: some LVM management operations will become slower but they won't depend on that daemon being active.
    – kostix
    Nov 19 at 14:58










  • lvmetad is not available in rescue. It should not influence operation. I can try disabling it via config anyway and see what happens, but I doubt it'll make a difference. I can't update my initramfs without access to my rootfs.
    – K.A.B.
    Nov 20 at 15:44













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have the following setup:



root@system:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 30G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 977M 0 part
│ └─md0 9:0 0 976,4M 0 raid1 /boot
└─sda3 8:3 0 29G 0 part
└─md1 9:1 0 29G 0 raid1
└─vg00-root_corig 253:3 0 29G 0 lvm
└─vg00-root 253:0 0 29G 0 lvm /
sdb 8:16 0 8G 0 disk
├─vg00-cache_cdata 253:1 0 8G 0 lvm
│ └─vg00-root 253:0 0 29G 0 lvm /
└─vg00-cache_cmeta 253:2 0 32M 0 lvm
└─vg00-root 253:0 0 29G 0 lvm /
sr0 11:0 1 1024M 0 rom
root@system:~# lvs -a
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
[cache] vg00 Cwi---C--- 7,93g 0,51 3,22 0,00
[cache_cdata] vg00 Cwi-ao---- 7,93g
[cache_cmeta] vg00 ewi-ao---- 32,00m
[lvol0_pmspare] vg00 ewi------- 32,00m
root vg00 Cwi-aoC--- 29,02g [cache] [root_corig] 0,51 3,22 0,00
[root_corig] vg00 owi-aoC--- 29,02g


As you can see I have a volume group vg00 that spans across 2 physical devices sda(sda3) and sdb. The lv root is placed on a raid1 md1. This raid device only has one disk. This doesn't make much sense for production use. Please ignore that for the moment. It does in other setups and is not relevant here.



The lv root is using a writethrough cache using dm-cache.



My problem: E.g. in case the system doesn't boot for whatever reason I need to be able to mount my lv root which contains the root fs to recover files or fix a broken installation. To do that I boot into a rescue evoirment and assemble the raid1:



root@rescue:/# mdadm --assemble md1 /dev/sda3
mdadm: /dev/md/md1 has been started with 1 drive.


However I cannot activate the lv root:



root@rescue:/# lvchange -a y vg00/root
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
/dev/mapper/vg00-cache_cmeta: open failed: No such file or directory


vgchange -a y vg00 produces the same result.



When trying often enough the required lvs cache_cmeta and cache_cdata sometimes become active (lvs -a). When that's the case I can create the device mapper files using vgmknodes and run lvchange -a y vg00/root or vgchange -a y to activate root and mount the device as usual. However this is not reliable.



I cannot activate the cache lvs manually:



root@rescue:/# lvchange -a y vg00/cache_cmeta
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
Unable to change internal LV vg00/cache_cmeta directly.


Question: What is the correct way to activate a cached lv?



I can uncache the lv using lvconcert --uncache vg00/root which works reliably, however I'm looking for a reliable way to mount the root lv without uncaching it first.










share|improve this question















I have the following setup:



root@system:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 30G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 977M 0 part
│ └─md0 9:0 0 976,4M 0 raid1 /boot
└─sda3 8:3 0 29G 0 part
└─md1 9:1 0 29G 0 raid1
└─vg00-root_corig 253:3 0 29G 0 lvm
└─vg00-root 253:0 0 29G 0 lvm /
sdb 8:16 0 8G 0 disk
├─vg00-cache_cdata 253:1 0 8G 0 lvm
│ └─vg00-root 253:0 0 29G 0 lvm /
└─vg00-cache_cmeta 253:2 0 32M 0 lvm
└─vg00-root 253:0 0 29G 0 lvm /
sr0 11:0 1 1024M 0 rom
root@system:~# lvs -a
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
[cache] vg00 Cwi---C--- 7,93g 0,51 3,22 0,00
[cache_cdata] vg00 Cwi-ao---- 7,93g
[cache_cmeta] vg00 ewi-ao---- 32,00m
[lvol0_pmspare] vg00 ewi------- 32,00m
root vg00 Cwi-aoC--- 29,02g [cache] [root_corig] 0,51 3,22 0,00
[root_corig] vg00 owi-aoC--- 29,02g


As you can see I have a volume group vg00 that spans across 2 physical devices sda(sda3) and sdb. The lv root is placed on a raid1 md1. This raid device only has one disk. This doesn't make much sense for production use. Please ignore that for the moment. It does in other setups and is not relevant here.



The lv root is using a writethrough cache using dm-cache.



My problem: E.g. in case the system doesn't boot for whatever reason I need to be able to mount my lv root which contains the root fs to recover files or fix a broken installation. To do that I boot into a rescue evoirment and assemble the raid1:



root@rescue:/# mdadm --assemble md1 /dev/sda3
mdadm: /dev/md/md1 has been started with 1 drive.


However I cannot activate the lv root:



root@rescue:/# lvchange -a y vg00/root
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
/dev/mapper/vg00-cache_cmeta: open failed: No such file or directory


vgchange -a y vg00 produces the same result.



When trying often enough the required lvs cache_cmeta and cache_cdata sometimes become active (lvs -a). When that's the case I can create the device mapper files using vgmknodes and run lvchange -a y vg00/root or vgchange -a y to activate root and mount the device as usual. However this is not reliable.



I cannot activate the cache lvs manually:



root@rescue:/# lvchange -a y vg00/cache_cmeta
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
Unable to change internal LV vg00/cache_cmeta directly.


Question: What is the correct way to activate a cached lv?



I can uncache the lv using lvconcert --uncache vg00/root which works reliably, however I'm looking for a reliable way to mount the root lv without uncaching it first.







linux debian lvm2






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 at 12:51

























asked Nov 19 at 12:45









K.A.B.

11




11












  • From this (and similar data I was able to find by searching), it follows that you should either start lvmedad, which is a daemon, before trying to carry other LVM operations, or disable it in the LVM config and update initramfs: some LVM management operations will become slower but they won't depend on that daemon being active.
    – kostix
    Nov 19 at 14:58










  • lvmetad is not available in rescue. It should not influence operation. I can try disabling it via config anyway and see what happens, but I doubt it'll make a difference. I can't update my initramfs without access to my rootfs.
    – K.A.B.
    Nov 20 at 15:44


















  • From this (and similar data I was able to find by searching), it follows that you should either start lvmedad, which is a daemon, before trying to carry other LVM operations, or disable it in the LVM config and update initramfs: some LVM management operations will become slower but they won't depend on that daemon being active.
    – kostix
    Nov 19 at 14:58










  • lvmetad is not available in rescue. It should not influence operation. I can try disabling it via config anyway and see what happens, but I doubt it'll make a difference. I can't update my initramfs without access to my rootfs.
    – K.A.B.
    Nov 20 at 15:44
















From this (and similar data I was able to find by searching), it follows that you should either start lvmedad, which is a daemon, before trying to carry other LVM operations, or disable it in the LVM config and update initramfs: some LVM management operations will become slower but they won't depend on that daemon being active.
– kostix
Nov 19 at 14:58




From this (and similar data I was able to find by searching), it follows that you should either start lvmedad, which is a daemon, before trying to carry other LVM operations, or disable it in the LVM config and update initramfs: some LVM management operations will become slower but they won't depend on that daemon being active.
– kostix
Nov 19 at 14:58












lvmetad is not available in rescue. It should not influence operation. I can try disabling it via config anyway and see what happens, but I doubt it'll make a difference. I can't update my initramfs without access to my rootfs.
– K.A.B.
Nov 20 at 15:44




lvmetad is not available in rescue. It should not influence operation. I can try disabling it via config anyway and see what happens, but I doubt it'll make a difference. I can't update my initramfs without access to my rootfs.
– K.A.B.
Nov 20 at 15:44















active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1376692%2fmount-cached-lvm2-volume-from-rescue-system%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1376692%2fmount-cached-lvm2-volume-from-rescue-system%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

What is the Guru Parampara of Kashmiri Shaivism?

Герой Советского Союза

AnyDesk - Fatal Program Failure