View previous topic :: View next topic |
Author |
Message |
kashani Advocate
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Mon Mar 31, 2003 11:12 am Post subject: stupid Unix tricks, changing filesys of /var on a live sys |
|
|
Having some qmail issues and it would be handy if I could change the filesystem of /var remotely. Something like
1. mkdir /home/newvar/ ;cd /var ; cp -a * /home/newvar
2. umount /var
3. format, etc
4. mount /var
5. copy files back
6. reboot and hope the box is happy, reinstall qmail.
I'm getting /var busy on the umount bit so I'm a little stuck. If this isn't something I'd actually want to do for one reason or another I'd consider that information useful too.
kashani _________________ Will personally fix your server in exchange for motorcycle related shop tools in good shape. |
|
Back to top |
|
|
gilesjuk Guru
Joined: 11 Feb 2003 Posts: 412 Location: Staffordshire, UK
|
Posted: Mon Mar 31, 2003 1:21 pm Post subject: Re: stupid Unix tricks, changing filesys of /var on a live s |
|
|
If you don't already have a /var partition then you don't umount it, just create the new /var partition and mount it.
/var is an important directory and such things should normally be fiddled with in singer user mode. _________________ ^<^>^<^>^
G. Jones
-=-=-=-=-=- |
|
Back to top |
|
|
arkhan_jg Apprentice
Joined: 18 Mar 2003 Posts: 199 Location: Dorset, UK
|
Posted: Mon Mar 31, 2003 1:41 pm Post subject: |
|
|
I'm sure there's a more elegent way of doing it using remount or mount --move (2.5 kernels), but the simplest way for me is
and stop all apps using /var long enough to unmount it!
(you can always mount it again in it's temporary location while you do the formatting)
Obviously, this is only relevent if you have /var as a separate partition.
Another option would be to alter your fstab to point /var to a temporary directory, reboot, copy the files to another temporary directory, format the /var partition, copy back, alter your fstab etc. The downside is, you'd lose all the logging your system did in the mean time, assuming you don't merge back in your log files. _________________ make menuconfig not war |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20485
|
Posted: Mon Mar 31, 2003 5:22 pm Post subject: |
|
|
Moved from Installing Gentoo. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
kashani Advocate
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Mon Mar 31, 2003 9:45 pm Post subject: |
|
|
arkhan_jg wrote: |
and stop all apps using /var long enough to unmount it!
(you can always mount it again in it's temporary location while you do the formatting)
Obviously, this is only relevent if you have /var as a separate partition.
Another option would be to alter your fstab to point /var to a temporary directory, reboot, copy the files to another temporary directory, format the /var partition, copy back, alter your fstab etc. The downside is, you'd lose all the logging your system did in the mean time, assuming you don't merge back in your log files. |
Ah... looks like I mised cron when I attempted it. I can take the hit on the system logs, the box is only running qmail for an announcement list, so I have some leeway if I completely destroy it.
I couldn't think of a way to reboot the box and have /home/newvar be the new /var partition... am I missing something completely obvious or just /etc/fstab unfancy?
kashani _________________ Will personally fix your server in exchange for motorcycle related shop tools in good shape. |
|
Back to top |
|
|
kashani Advocate
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Tue Apr 01, 2003 11:28 pm Post subject: it worked oddly enough |
|
|
No problems other than resintalling qmail, that was a given as qmail gets really unhappy when you touch anything in the queue and apparently changing the filesystem qualifies.
The other thing I learned was make sure you have installed all the software you need before starting, ie reiserprogs.
kashani _________________ Will personally fix your server in exchange for motorcycle related shop tools in good shape. |
|
Back to top |
|
|
|