Move directory to own mount point

Hi,
I’m using LVM and have two mount points:
/dev/system/root mapped to /
/dev/system/home mapped to /home

I’s like now to have a separate volume for /var, but I’m not entirely sure how to do it.
I can create LVM volume /dev/system/var to be ready for my /var, but how do I move the data from the existing /var there?
Do I need to unmount / ? I think that can be done only on offline system, or am I wrong here?
Can someone help with the migration steps here?

Thanks,
Peter

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mount /dev/system/var to somewhere temporarily, like /tmp/var (make a
new /tmp/var directory for this) and then copy all your data over
recursively, preserving ownerships, permissions, etc. Once that is done
just mount /dev/system/var to /var in your /etc/fstab file and reboot to
make sure everything works properly.

Good luck.

Pezet wrote:
> Hi,
> I’m using LVM and have two mount points:
> /dev/system/root mapped to /
> /dev/system/home mapped to /home
>
> I’s like now to have a separate volume for /var, but I’m not entirely
> sure how to do it.
> I can create LVM volume /dev/system/var to be ready for my /var, but
> how do I move the data from the existing /var there?
> Do I need to unmount / ? I think that can be done only on offline
> system, or am I wrong here?
> Can someone help with the migration steps here?
>
> Thanks,
> Peter
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJC4ZE3s42bA80+9kRApKlAJ487G3wKQaNY2kgujHL/WM8I1NqKwCfSLTd
b1jrlYFnFmEJlnUWVdl8wU4=
=SxcI
-----END PGP SIGNATURE-----

That is the right solution, but may I add something?

To recover the space the old /var takes, after the test mount above, unmount again, do a rm -rf /var/* and mount again.

Or am I talking nuts?

I need advice along a similar line. I have
/dev/system/root mapped to /
/dev/system/home not mapped
I want to map /dev/system/home to /home. Do I need to map /dev/system/home to a temporary mount point, move all of /home there, and then remount /dev/system/home to /home?

would this work with replacing (upgrading) an hdd that has been mounted as a sub-directory?
replace a 500 GB HDD mounted as /home/landis/Graphics/Photographs/PhotoBooks/ with a new 1 or 2 TB hdd?
Temporarily mount current …/PhotoBooks/ as something else, mount New HDD as Permanent ‘PhotoBooks’ and then copy all the data over from Old ‘photobooks’ hdd?

I’m concerned that mounting the original ‘photobooks’ drive as something else will trash the file table or track zero, but at the same time, i know i can mount, unmount and remount ‘external’ drives on different machines without data loss… Just worried… : )

Thanks,
Landis.

Build in the second HDD,
create a partition
have it mounted in /mnt
move or copy the folder Photobooks to /mnt
remove the fstab entry for the 500 GB disk
change the mountpoint in Yast from /mnt to /home/landis/Graphics/Photographs

If needed, shutdown and remove 500 GB disk.

No concern needed, I’ve been copying my /home from disk to new and bigger disk since 2001.

Knurpht, Thank you… you make it sound as easy as I thought it should be.

Спасибо,
Landis.