LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-01-2004, 05:43 PM   #1
TexasDex
Member
 
Registered: Feb 2003
Location: The Attic. Nowhere near Texas.
Distribution: Gentoo, Kubuntu, formerly LFS, SuSE, and RedHat
Posts: 133

Rep: Reputation: 15
Moving contents of /var to separate partition


I have recently run rather short on my root partition and decided to expand. I added a second hard disk to the computer a while ago and it has sit mostly unused because a good portion of the material I added went into /var/www/html/photos instead of /mnt/hdb1 where I had mounted the second drive.

Now as the space is becoming more necessary I would like to move the website and whatever else to the /var partition. I have only moved some windows programs on a Samba share to the new hard disk so far (path: /mnt/hdb1/content), and that would go fine in /var, so I want to move the entire /var directory to the second hard disk, and remount it as /var

Is there anything special I should do, aside from just copying the whole contents of /var/ to /mnt/hdb1/, updating fstab, and remounting /dev/hdb1? How do I preserve permissions and timestamps when copying the files? What about the server that is currently running?

I'm guessing that I would need to switch Apache off, but I don't know what else might be running and what I should disable before doing that.

Process List:
Code:
  PID TTY          TIME CMD
    1 ?        00:00:04 init
    2 ?        00:00:09 keventd
    3 ?        00:00:04 kapmd
    4 ?        00:00:39 ksoftirqd_CPU0
    5 ?        00:01:29 kswapd
    6 ?        00:00:02 bdflush
    7 ?        00:00:03 kupdated
    8 ?        00:00:00 mdrecoveryd
   12 ?        00:08:03 kjournald
   68 ?        00:00:00 khubd
  163 ?        00:00:00 kjournald
  164 ?        00:00:03 kjournald
  165 ?        00:00:02 kjournald
  465 ?        00:00:03 syslogd
  469 ?        00:00:00 klogd
  578 ?        00:00:11 sshd
  592 ?        00:00:00 xinetd
  605 ?        00:00:02 lpd
  616 ?        00:00:01 gpm
  627 ?        00:00:33 httpd
  636 ?        00:00:00 crond
  643 ?        00:00:00 mysqld_safe
  684 ?        00:21:44 mysqld
  710 ?        00:00:19 xfs
  723 ?        00:00:02 smbd
  735 ?        00:02:22 nmbd
  737 ?        00:00:00 nmbd
  754 ?        00:00:00 atd
  771 ?        00:00:36 Xvnc
  788 ?        00:00:00 mwm
  790 ?        00:00:00 Xvnc
  797 ?        00:00:00 xstartup
  802 ?        00:00:00 xterm
  803 ?        00:00:00 mwm
  804 ?        00:00:01 gedit
  826 pts/1    00:00:00 bash
  894 ?        00:00:04 noip2
  896 ?        00:00:00 login
  897 tty2     00:00:00 mingetty
  898 tty3     00:00:00 mingetty
  899 tty4     00:00:00 mingetty
  900 tty5     00:00:00 mingetty
  901 tty6     00:00:00 mingetty
  998 ?        00:00:01 gnome_segv2
15015 tty1     00:00:00 bash
15246 ?        00:00:36 artsd
15267 ?        00:27:39 autorun
22897 ?        00:00:00 nessusd
27988 ?        00:00:00 xterm
27990 pts/0    00:00:00 bash
 6122 ?        00:00:18 httpd
 6123 ?        00:00:16 httpd
 6124 ?        00:00:19 httpd
 6125 ?        00:00:16 httpd
 6126 ?        00:00:22 httpd
 6127 ?        00:00:21 httpd
 6128 ?        00:00:24 httpd
 6129 ?        00:00:17 httpd
 6537 ?        00:00:00 kdm
 6549 ?        00:08:22 X
 6550 ?        00:00:00 kdm
 6555 ?        00:00:00 startkde
 6598 ?        00:00:00 ssh-agent
 6645 ?        00:00:00 kdeinit
 6649 ?        00:00:00 kdeinit
 6652 ?        00:00:00 kdeinit
 6654 ?        00:02:34 kdeinit
 6663 ?        00:00:13 artsd
 6669 ?        00:00:02 kdeinit
 6670 ?        00:00:00 kwrapper
 6672 ?        00:00:01 kdeinit
 6673 ?        00:00:50 kdeinit
 6675 ?        00:00:15 kdeinit
 6677 ?        00:01:46 kdeinit
 6686 ?        00:00:02 kdeinit
 6687 ?        00:01:03 kdeinit
 6689 ?        00:00:47 kdeinit
 6690 ?        00:00:01 pam-panel-icon
 6691 ?        00:00:00 gpilotd
 6693 ?        00:00:05 kdeinit
 6695 ?        00:00:02 kalarmd
 6697 ?        00:00:00 pam_timestamp_c
 6699 ?        00:00:00 gnome-name-serv
 6706 pts/4    00:00:00 bash
 6794 ?        00:04:48 xmms
 6934 ?        11:44:39 kdf
 6943 ?        00:00:03 kdeinit
 6997 ?        00:00:02 kdesktop_lock
 7323 ?        00:00:15 httpd
 7396 ?        00:00:06 httpd
 7397 ?        00:00:14 httpd
 7398 ?        00:00:12 httpd
 7403 ?        00:00:09 httpd
 7404 ?        00:00:12 httpd
 7405 ?        00:00:08 httpd
 7406 ?        00:00:06 httpd
 7407 ?        00:00:10 httpd
 7408 ?        00:00:10 httpd
 7409 ?        00:00:12 httpd
 7410 ?        00:00:12 httpd
 9018 ?        00:00:46 smbd
 9071 ?        00:00:00 smbd
 9113 pts/0    00:00:26 kdf
 9115 ?        00:00:00 kdeinit
 9118 ?        00:00:00 kdeinit
 9121 ?        00:00:00 kdeinit
 9123 ?        00:00:14 kdeinit
 9371 ?        00:00:00 sshd
 9374 pts/5    00:00:00 bash
 9662 pts/5    00:00:00 ps
Is it possible/likely that any of those processes are using files in /var?

Am I forgetting anything?
 
Old 03-01-2004, 05:55 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
apach (=httpd) for sure, as well as anything that
writes a log-file :) Mysql probably will ... and things
with lock-files, too .... best to do a init 1 to minimize
this...


Cheers,
Tink
 
Old 03-01-2004, 08:30 PM   #3
TexasDex
Member
 
Registered: Feb 2003
Location: The Attic. Nowhere near Texas.
Distribution: Gentoo, Kubuntu, formerly LFS, SuSE, and RedHat
Posts: 133

Original Poster
Rep: Reputation: 15
oh duh.. I shoulda thought of that.

I found the -p option for cp to preserve permissions and the -r option to copy all of the files.

Rebooted in single-user mode, with esentially nothing started, renamed /var to /varback. made a new /var, mounted hdb1 on it, and copied. No problems so far, I think i'll delete the varback in a few days once there's no problem with anything. Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
moving /home /root & /var to new partition CrashedAgain Linux - General 8 11-24-2005 10:44 AM
/var/lib/mysql contents - What to backup chakkerz Linux - General 3 05-25-2005 10:25 PM
Moving /var/adm and /var/lib - why does it hurt? J_Szucs Linux - General 1 09-15-2004 06:46 PM
reposition gimp selection area without moving contents mrtwice Linux - Software 6 12-19-2003 04:26 PM
Moving /var to new partition burnpile Slackware 2 12-10-2003 12:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration