Re: Moving Directory help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dan Track wrote:
Hi

I've got /var in the root filesystem. What I would like to do is move
it to a new separate partition. I've created the partition but when I
mount /var onto it /var is empty. If I umount it I can see all the
directories again e.g /var/log. Can someone please tell me why this is
happening and find a way round this?


This is the expected result.

When you create a new partition and make a new empty file system in it,
the file system is empty of files.  When you mount this onto /var,
an then look at /var, the OS is showing you what's in
your new empty file system you've just created and mounted.  The
original /var contents is "under" the /var mount and will only be
accessible when you unmount the empty file system you mounted on /var.

In order to have all the original contents in the newly created
partition and file system, you will have to do something like this:
1) Boot into Linux Rescue from FC media.  This is because you
   will need to copy files in /var, which may not be readable or
   removable if a process is using them.
2) Mount the new partition/file system somewhere like varnew
3) Copy var into varnew, remove var (to recover the disk space)
   taking care to keep permissions the same.  Something like
   # cd to / on the original root disk (not the running live / )
   # cd var; tar cf - . | (cd varnew; tar xvf - )
4) Unmount varnew and mount it as var.  Make sure this is set
   in etc/fstab so that the system will have the new partition/
   file system as /var when we boot.
4) Reboot

Good luck,
Khoa Ton




--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux