In-place migration to LVM?

Hello,

I have a data file collection on three hard disks, each with just one partition. The 'primary' partition has the complete directory structure. The two 'secondary' partitions partially mirror that directory structure. There are some data files on the primary partition. For each data file on one of the secondary partitions, there is a soft link to it from the primary partition. Each partition has a couple of GB space left.

Is it possible to migrate these partitions into one logical volume without loosing or backing up the data? If I had a backup storage large enough to hold all the data ...

Thanks in advance,
Malte

--

0

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

In-place migration to LVM?

On Wed, Nov 21, 2007 at 05:22:50PM +0100, Malte Forkel wrote:
>
> I have a data file collection on three hard disks, each with just one
> partition. The 'primary' partition has the complete directory structure.
> The two 'secondary' partitions partially mirror that directory structure.
> There are some data files on the primary partition. For each data file on
> one of the secondary partitions, there is a soft link to it from the
> primary partition. Each partition has a couple of GB space left.
> Is it possible to migrate these partitions into one logical volume without
> loosing or backing up the data? If I had a backup storage large enough to
> hold all the data ...

Ouch.

First, ensure that you have exhausted all backup options. Backup to
another machine?

How large are these disks? You say each has a couple of GB spare; is
that free-space on the drive or that a partition with a filesystem that
has some free space?

You don't necessarily need backup storage large enough for all the data,
just do do one partition at a time.

Is the data already compressed?

I've never tried resizing non-LVM partitions so I wouldn't attempt that
without a backup. Hey, I don't attempt anything without a backup;
including doing a backup.

Your best bet may be to buy a fourth disk and make it the firs physical
volume of a volume group, make your LV and put a filesystem on it.
Transfer one drives data to it and do the shell-game from there.

Or create an LV+filesystem and use it to hold a compressed tarball of
the first data partition. It all depends on the size of the data set
and the size of these drives.

Doug.

--

In-place migration to LVM?

Douglas A. Tutty schrieb:
> On Wed, Nov 21, 2007 at 05:22:50PM +0100, Malte Forkel wrote:
>> I have a data file collection on three hard disks, each with just one
>> partition. The 'primary' partition has the complete directory structure.
>> The two 'secondary' partitions partially mirror that directory structure.
>> There are some data files on the primary partition. For each data file on
>> one of the secondary partitions, there is a soft link to it from the
>> primary partition. Each partition has a couple of GB space left.
>> Is it possible to migrate these partitions into one logical volume without
>> loosing or backing up the data? If I had a backup storage large enough to
>> hold all the data ...
>
> Ouch.
>
> First, ensure that you have exhausted all backup options. Backup to
> another machine?
>
> How large are these disks? You say each has a couple of GB spare; is
> that free-space on the drive or that a partition with a filesystem that
> has some free space?
>
> You don't necessarily need backup storage large enough for all the data,
> just do do one partition at a time.
>
> Is the data already compressed?
>
The disks have 500, 400, and 160 GB. They are used by VDR to store digital video in an MPEG2 based format. I probably can't gain much by attempting to compress the data.

Having a backup would sure be nice, but its not what I attempting to achieve at the moment. I guess if I wanted to be on the safe side, I'd buy two 1 TB drives and build a RAID array. Right now, I was just hoping that I could migrate from three separate partitions (managed by VDR) to one LVM partition in order to ease mounting via NFS now and drive replacements later.

> I've never tried resizing non-LVM partitions so I wouldn't attempt that
> without a backup. Hey, I don't attempt anything without a backup;
> including doing a backup.
>
:-)

> Your best bet may be to buy a fourth disk and make it the firs physical
> volume of a volume group, make your LV and put a filesystem on it.
> Transfer one drives data to it and do the shell-game from there.
>
The next disk I buy is going to be a 1000 GB model. Moving from regular partitions to LVM shoudn't be a problem then. But at the moment, 1 TB disks are still a little bit to expansive for me.

> Or create an LV+filesystem and use it to hold a compressed tarball of
> the first data partition. It all depends on the size of the data set
> and the size of these drives.
>
> Doug.
>
>
Thanks for your help!

Malte

--

In-place migration to LVM?

On Wed, Nov 28, 2007 at 05:41:43PM +0100, Malte Forkel wrote:
> Douglas A. Tutty schrieb:
> >On Wed, Nov 21, 2007 at 05:22:50PM +0100, Malte Forkel wrote:
> >>I have a data file collection on three hard disks, each with just one
> >>partition. The 'primary' partition has the complete directory structure.
> >>The two 'secondary' partitions partially mirror that directory structure.
> >>There are some data files on the primary partition. For each data file on
> >>one of the secondary partitions, there is a soft link to it from the
> >>primary partition. Each partition has a couple of GB space left.
> >>Is it possible to migrate these partitions into one logical volume
> >>without loosing or backing up the data? If I had a backup storage large
> >>enough to hold all the data ...
> >
> >Ouch.
> >
> >First, ensure that you have exhausted all backup options. Backup to
> >another machine?
> >
> >How large are these disks? You say each has a couple of GB spare; is
> >that free-space on the drive or that a partition with a filesystem that
> >has some free space?
> >
> >You don't necessarily need backup storage large enough for all the data,
> >just do do one partition at a time.
> >
> >Is the data already compressed?
> >
> The disks have 500, 400, and 160 GB. They are used by VDR to store digital
> video in an MPEG2 based format. I probably can't gain much by attempting to
> compress the data.
>
> Having a backup would sure be nice, but its not what I attempting to
> achieve at the moment. I guess if I wanted to be on the safe side, I'd buy
> two 1 TB drives and build a RAID array. Right now, I was just hoping that I
> could migrate from three separate partitions (managed by VDR) to one LVM
> partition in order to ease mounting via NFS now and drive replacements
> later.
> >I've never tried resizing non-LVM partitions so I wouldn't attempt that
> >without a backup. Hey, I don't attempt anything without a backup;
> >including doing a backup.
> >
> :-)
>
> >Your best bet may be to buy a fourth disk and make it the firs physical
> >volume of a volume group, make your LV and put a filesystem on it.
> >Transfer one drives data to it and do the shell-game from there.
> >
> The next disk I buy is going to be a 1000 GB model. Moving from regular
> partitions to LVM shoudn't be a problem then. But at the moment, 1 TB disks
> are still a little bit to expansive for me.
>
> >Or create an LV+filesystem and use it to hold a compressed tarball of
> >the first data partition. It all depends on the size of the data set
> >and the size of these drives.

I've never tried it, but I wonder if you can use a file as a PV for LVM?
Take the free space, dd a file to fill it, add them to an LV and move
the data from one drive to it. Then add the newly emptied drive to the
LV and remove the files (migrating the data).

Or, since you want to offer this via NFS, is there any way to coble
other computers together and create something like an AFS cluster to
hold the data?

Doug.

--

In-place migration to LVM?

> I have a data file collection on three hard disks, each with just one
> partition. The 'primary' partition has the complete directory structure. The
> two 'secondary' partitions partially mirror that directory structure. There
> are some data files on the primary partition. For each data file on one of
> the secondary partitions, there is a soft link to it from the primary
> partition. Each partition has a couple of GB space left.

> Is it possible to migrate these partitions into one logical volume without loosing or backing up the data? If I had a backup storage large enough to hold all the data ...

If you really really really really want to do it, it can probably
be done. Something like:

- shrink each partition as much as you can (using resize2fs or
somesuch).
- move each one of those partitions to the end of the drive.
this can be done with parted or manually with dd.
- create a new partition on the now free space on each drive.
- give those partitions to LVM.
- create an LVM group and volume, create a filesystem on it and
mount it.
- move as much as you can from the old 3 partitions to the new
LVM partition.
- now you have more free space in your old partitions, so, again:
shrink them, move them to the end of the drive.
- grow your 3 LVM partition with the space newly created.
- move as much as you can from the old 3 partitions to the new
LVM partition.
- repeat until the old partitions are empty.

The more free space, the faster.

I've done similar things (tho on a single drive), so I know it can
be done.

But I strongly recommend you don't do that, even if you can find a spare
drive to temporarily hold your data and make the whole thing less
painful: spreading a single partition over 3 drives means that if one of
the drives fails, you'll most likely lose most/all of the data rather
than just a third of it.

Stefan

--

Syndicate content