* [linux-lvm] recovering data from inside a partitioned lv
@ 2009-06-22 17:23 Anthony Clark
2009-06-22 17:32 ` Christian Völker
2009-06-22 17:42 ` Bryn M. Reeves
0 siblings, 2 replies; 4+ messages in thread
From: Anthony Clark @ 2009-06-22 17:23 UTC (permalink / raw)
To: linux-lvm
Hi,
The following stupid mistake was made :( A pv, vg and lv were
created, and then the documentation was misread, and a partition was
created inside the lv. Said partition mounted fine, and allowed fs
creation along with large amounts of data to be copied. Partition was
accessible via /dev/vg1/lv1p1.
Server has been rebooted, and now only /dev/vg1/lv1 is shown. parted
can open the lv and shows 1 partition inside, but doesn't understand
ext3 volumes, so can't copy the partition to another disk. tune2fs
can't see /dev/vg1/lv1p1, or I'd use that to change the fs type to ext2.
Is there a way to undo the stupid mistake and get at the partition
inside the logical volume? That is to say, mount the partition, copy
the data out and then create the filesystem correctly. Is there a way
to force /dev/vg1/lv1p1 to show up again?
Thanks in advance for helping :)
-a
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [linux-lvm] recovering data from inside a partitioned lv
2009-06-22 17:23 [linux-lvm] recovering data from inside a partitioned lv Anthony Clark
@ 2009-06-22 17:32 ` Christian Völker
2009-06-22 17:57 ` Anthony Clark
2009-06-22 17:42 ` Bryn M. Reeves
1 sibling, 1 reply; 4+ messages in thread
From: Christian Völker @ 2009-06-22 17:32 UTC (permalink / raw)
To: LVM general discussion and development
Hi,
> Server has been rebooted, and now only /dev/vg1/lv1 is shown. parted
> can open the lv and shows 1 partition inside, but doesn't understand
> ext3 volumes, so can't copy the partition to another disk. tune2fs
> can't see /dev/vg1/lv1p1, or I'd use that to change the fs type to ext2.
I think the partition entry under /dev is missing. After the initial
fdisk it was created.
So two ways to recover:
-Open fdisk on the lv. Do not do any changes, but leave and (w)rite. I'd
say the entries lv1p1 will be re-created then. Mount it, copy the data
and get rid of partition.
-Use loop device. This is much more complicated but will work, though:
losetup -o$[512*63] /dev/loop1 /dev/vg1/lv1
So it will create a loop device /dev/loop1 from lv1 with an offset of
512*63 (default blocksize and partitioning schema, may vary thought) .
And then simply mount the loop device with the "-o loop" option for
mount. Copy and get rid of partition.
Hope this helps, let us know if it does.
GReetings
Christian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [linux-lvm] recovering data from inside a partitioned lv
2009-06-22 17:23 [linux-lvm] recovering data from inside a partitioned lv Anthony Clark
2009-06-22 17:32 ` Christian Völker
@ 2009-06-22 17:42 ` Bryn M. Reeves
1 sibling, 0 replies; 4+ messages in thread
From: Bryn M. Reeves @ 2009-06-22 17:42 UTC (permalink / raw)
To: LVM general discussion and development
On Mon, 2009-06-22 at 13:23 -0400, Anthony Clark wrote:
> Hi,
>
> The following stupid mistake was made :( A pv, vg and lv were
> created, and then the documentation was misread, and a partition was
> created inside the lv. Said partition mounted fine, and allowed fs
> creation along with large amounts of data to be copied. Partition was
> accessible via /dev/vg1/lv1p1.
>
> Server has been rebooted, and now only /dev/vg1/lv1 is shown. parted
> can open the lv and shows 1 partition inside, but doesn't understand
> ext3 volumes, so can't copy the partition to another disk. tune2fs
> can't see /dev/vg1/lv1p1, or I'd use that to change the fs type to ext2.
>
> Is there a way to undo the stupid mistake and get at the partition
> inside the logical volume? That is to say, mount the partition, copy
> the data out and then create the filesystem correctly. Is there a way
> to force /dev/vg1/lv1p1 to show up again?
kpartx -a /dev/vg1/lv1
Will create maps for all the partitions defined inside the LV. See man
kpartx for the remaining options.
Cheers,
Bryn.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [linux-lvm] recovering data from inside a partitioned lv
2009-06-22 17:32 ` Christian Völker
@ 2009-06-22 17:57 ` Anthony Clark
0 siblings, 0 replies; 4+ messages in thread
From: Anthony Clark @ 2009-06-22 17:57 UTC (permalink / raw)
To: LVM general discussion and development
The loop device solution worked!
thank you Christian!
--
Anthony Clark - anthony@merit.edu
734 527 5744 - (aim)anthonyclark
On Jun 22, 2009, at 1:32 PM, Christian V�lker wrote:
> Hi,
>
>> Server has been rebooted, and now only /dev/vg1/lv1 is shown. parted
>> can open the lv and shows 1 partition inside, but doesn't understand
>> ext3 volumes, so can't copy the partition to another disk. tune2fs
>> can't see /dev/vg1/lv1p1, or I'd use that to change the fs type to
>> ext2.
> I think the partition entry under /dev is missing. After the initial
> fdisk it was created.
> So two ways to recover:
> -Open fdisk on the lv. Do not do any changes, but leave and (w)rite.
> I'd
> say the entries lv1p1 will be re-created then. Mount it, copy the data
> and get rid of partition.
> -Use loop device. This is much more complicated but will work, though:
> losetup -o$[512*63] /dev/loop1 /dev/vg1/lv1
> So it will create a loop device /dev/loop1 from lv1 with an offset of
> 512*63 (default blocksize and partitioning schema, may vary thought) .
> And then simply mount the loop device with the "-o loop" option for
> mount. Copy and get rid of partition.
>
> Hope this helps, let us know if it does.
> GReetings
>
> Christian
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-06-22 17:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-22 17:23 [linux-lvm] recovering data from inside a partitioned lv Anthony Clark
2009-06-22 17:32 ` Christian Völker
2009-06-22 17:57 ` Anthony Clark
2009-06-22 17:42 ` Bryn M. Reeves
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.