Gentoo Archives: gentoo-user

From: Daniel Rose <drose@×××××××.au>
To: gentoo-user@l.g.o
Subject: [gentoo-user] LVM problems -- mounting a foreign drive
Date: Sat, 03 Nov 2007 01:43:13
Message-Id: 472BCF7F.2070307@nla.gov.au
1 Hi everyone,
2
3 I have an LVM comprising 2 partitions on a drive I wish to read data from, and I have a 'main'
4 file from somewhere in /etc/lvm from that old drive:
5
6
7 main {
8 id = "em7z2K-GhvB-mpW4-YNjE-SiZ7-zia2-PIObh2"
9
10 [...]
11 physical_volumes {
12
13 pv0 {
14 id = "6oVVgd-WIVK-qB0y-PXk2-Acu5-ZxcI-gMj5JD"
15 device = "/dev/md2" # Hint only
16 status = ["ALLOCATABLE"] # 74.4062 Gigabytes
17 }
18 }
19
20 logical_volumes {
21 root {
22 id = "Cu9udo-QFcL-72XW-G1OU-1sQA-giBa-WASzs2"
23 status = ["READ", "WRITE", "VISIBLE"] # 74.125Gigabytes
24 }
25 }
26
27 swap {
28 id = "aM7Jm4-QfMW-4y2c-zCv3-0O6f-CVzz-P3Ebg4"
29 status = ["READ", "WRITE", "VISIBLE"] #256 Megabytes
30 }
31
32
33
34 some bits snipped, obviously.
35
36 Anyway so the lone disk is in a separate box now:
37
38 Device Boot Start End Blocks Id System
39 /dev/hdd1 * 1 13 104391 fd Linux raid
40 autodetect
41 /dev/hdd2 14 9729 78043770 fd Linux raid
42 autodetect
43
44 So...
45
46 sudo pvcreate -u 6oVVgd-WIVK-qB0y-PXk2-Acu5-ZxcI-gMj5JD /dev/hdd2
47
48 Software RAID md superblock detected on /dev/hdd2. Wipe it? [y/n] n
49 Physical volume "/dev/hdd2" successfully created
50
51 Then....
52
53 pvdisplay
54 --- NEW Physical volume ---
55 PV Name /dev/hdd2
56 VG Name
57 PV Size 74.43 GB
58 Allocatable NO
59 PE Size (KByte) 0
60 Total PE 0
61 Free PE 0
62 Allocated PE 0
63 PV UUID 6oVVgd-WIVK-qB0y-PXk2-Acu5-ZxcI-gMj5JD
64
65
66
67 Then....
68 sudo vgcreate -v main /dev/hdd2
69 Wiping cache of LVM-capable devices
70 Adding physical volume '/dev/hdd2' to volume group 'main'
71 /dev/hdd2 not identified as an existing physical volume
72 Unable to add physical volume '/dev/hdd2' to volume group 'main'.
73
74
75 oh dear.
76
77
78 As it turns out, I can run pvcreate and pvdisplay ok, but a second run
79 of pvdisplay... and it's gone. vgcreate always fails.
80
81 Any ideas anyone? I'm a little startled at how hard it seems to be to mount a 'foreign' LVM drive in Linux.
82
83
84
85
86 --
87 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] LVM problems -- mounting a foreign drive Dirk Heinrichs <dirk.heinrichs.ext@×××.com>