LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-28-2007, 01:27 PM   #1
a550ee
LQ Newbie
 
Registered: Apr 2006
Posts: 16

Rep: Reputation: 0
Problem moving /var to separate partition


Hello!
I have ubuntu distro which lives on one hard drive: /boot on one partition, / on another and swap aslo on another.
Then I've moved all data from one hard drive to another. I've carefully re-created partition layout and also made separate partition for /var directory.

I've also tuned /etc/fstab; it was:
Code:
-/dev/sda5      /               ext3    defaults,errors=remount-ro 0       1
-/dev/sda6      /home           ext3    defaults,user_xattr        0       2
become:
Code:
+/dev/sda7      /               ext3    defaults,errors=remount-ro 0       1
+/dev/sda8      /var            ext3    defaults 0       0
+/dev/sda9      /home           ext3    defaults,errors=remount-ro,user_xattr
Then I've moved contents of /var to /dev/sda8 and leave /var on / empty.

Problem is during boot process I get error messages /var/lock and /var/run mountpoints doesn't exist.
This causes network facilities to fail to start.

I have lock and run in /var on /dev/ sda8. Why it asks for them on sda7?
 
Old 09-29-2007, 06:13 AM   #2
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
It is looking for these directories on sda7 because it has not mounted the /var partition at boot time.

Therefore it is finding an empty /var directory.

Try changing the /etc/fstab file:
Code:
/dev/sda7      /               ext3    defaults,errors=remount-ro 0       1
/dev/sda8      /var            ext3    defaults,errors=remount-ro 0       2
/dev/sda6      /home           ext3    defaults,user_xattr        0       3
The sixth field denotes the order that the file systems will be checked (zero means the filesystem will not be checked).

Changing this value to a 2 means the filesystem will be checked at bootup.

Adding the errors=remount-ro option will mount the /var as read only if it is unable to mount it as read-write.
 
Old 09-29-2007, 10:09 AM   #3
a550ee
LQ Newbie
 
Registered: Apr 2006
Posts: 16

Original Poster
Rep: Reputation: 0
That doesn't help. That's ubuntu's pecularities I don't understand. Now I ended with /var on the same partition as / but all contents except for run and lock moved to separate partition and symlinked back.

fs_passno=3 is errorous here.

My fs_passno=0 for /var makes no sense. Thanks!
 
Old 09-29-2007, 11:45 AM   #4
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
It's quite possible the the data were copied incorrectly. You need to use cp -ax *. Of course, it is also possible that some permissions were changed. Check the permissions on your var partition:

ls -l /var

The output should look something like this:

Quote:
drwxr-xr-x 2 root root 4096 2007-09-29 04:09 backups
drwxr-xr-x 21 root root 4096 2007-09-23 15:30 cache
drwxrwxrwt 2 root root 137 2007-09-29 04:03 crash
drwxr-xr-x 3 root root 4096 2007-09-02 05:38 games
drwxr-xr-x 68 root root 4096 2007-09-25 15:10 lib
drwxrwsr-x 2 root staff 6 2007-04-12 11:11 local
drwxrwxrwt 4 root root 80 2007-09-29 16:43 lock
drwxr-xr-x 17 root root 4096 2007-09-29 16:43 log
drwxrwsr-x 2 root mail 6 2007-08-31 05:02 mail
drwxr-xr-x 2 root root 6 2007-08-31 05:02 opt
drwxr-xr-x 20 root root 960 2007-09-29 16:57 run
drwxr-xr-x 7 root root 82 2007-09-25 15:10 spool
drwxr-xr-x 7 www-data www-data 90 2007-09-23 11:12 svn
drwxrwxrwt 3 root root 47 2007-09-29 05:23 tmp
drwxr-xr-x 5 root root 52 2007-09-02 07:20 www
 
Old 09-30-2007, 06:17 AM   #5
a550ee
LQ Newbie
 
Registered: Apr 2006
Posts: 16

Original Poster
Rep: Reputation: 0
I've been using -dprx keys for cp command. As far as I know it's the same as -ax. /var looks like this:
Code:
lrwxrwxrwx  1 root root   16 2007-09-29 18:49 backups -> /mnt/var/backups
lrwxrwxrwx  1 root root   14 2007-09-29 18:49 cache -> /mnt/var/cache
lrwxrwxrwx  1 root root   14 2007-09-29 18:49 crash -> /mnt/var/crash
lrwxrwxrwx  1 root root   14 2007-09-29 18:49 games -> /mnt/var/games
lrwxrwxrwx  1 root root   12 2007-09-29 18:49 lib -> /mnt/var/lib
lrwxrwxrwx  1 root root   14 2007-09-29 18:49 local -> /mnt/var/local
drwxrwxrwt  2 root root   40 2007-09-30 13:37 lock
lrwxrwxrwx  1 root root   12 2007-09-29 18:49 log -> /mnt/var/log
drwx------  2 root root 4096 2007-09-27 21:32 lost+found
lrwxrwxrwx  1 root root   13 2007-09-29 18:49 mail -> /mnt/var/mail
lrwxrwxrwx  1 root root   16 2007-09-29 18:49 network -> /mnt/var/network
lrwxrwxrwx  1 root root   12 2007-09-29 18:49 opt -> /mnt/var/opt
drwxr-xr-x 13 root root  740 2007-09-30 15:05 run
lrwxrwxrwx  1 root root   14 2007-09-29 18:49 spool -> /mnt/var/spool
lrwxrwxrwx  1 root root   12 2007-09-29 18:49 tmp -> /mnt/var/tmp
lrwxrwxrwx  1 root root   12 2007-09-29 18:49 www -> /mnt/var/www
At the same time /mnt/var looks like this:
Code:
drwxr-xr-x  2 root root   4096 2007-09-30 09:50 backups
drwxr-xr-x 20 root root   4096 2007-09-29 22:25 cache
drwxrwxrwt  2 root root   4096 2007-09-29 18:56 crash
drwxr-xr-x  2 root root   4096 2007-05-09 23:23 games
drwxr-xr-x 67 root root   4096 2007-09-30 09:53 lib
drwxrwsr-x  2 root staff  4096 2007-04-12 13:11 local
drwxrwxrwt  2 root root   4096 2007-09-27 11:45 lock
drwxr-xr-x 15 root root   4096 2007-09-30 09:50 log
drwx------  2 root root  16384 2007-09-27 21:32 lost+found
drwxrwsr-t  2 root mail   4096 2007-05-20 16:23 mail
drwxr-xr-x  2 root root   4096 2007-09-28 08:33 network
drwxr-xr-x  2 root root   4096 2007-04-15 15:48 opt
drwxr-xr-x 12 root root   4096 2007-09-29 18:39 run
drwxr-xr-x  8 root root   4096 2007-09-15 21:50 spool
drwxrwxrwt  4 root root   4096 2007-09-29 22:44 tmp
drwxr-xr-x  3 root root   4096 2007-09-15 15:26 www
Thanks for care!
 
Old 09-30-2007, 02:06 PM   #6
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
/mnt/var? You mean that your var is currently mounted on /mnt/var and not simply /var? In that case your fstab needs to read /mnt/var for the mount point, not /var.
 
Old 10-02-2007, 03:09 PM   #7
a550ee
LQ Newbie
 
Registered: Apr 2006
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jay73 View Post
/mnt/var? You mean that your var is currently mounted on /mnt/var and not simply /var? In that case your fstab needs to read /mnt/var for the mount point, not /var.
Yep now it's:
Code:
/dev/sda2       /boot           ext3    defaults                                                                0       2
/dev/sda7       /               ext3    defaults,errors=remount-ro                                              0       1
/dev/sda8       /mnt/var        ext3    defaults                                                                0       2 
/dev/sda9       /home           ext3    defaults,user_xattr                                                     0       2
 
  


Reply



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
[SOLVED] Moving /boot to separate partition and using 'grub' to boot eldiener Linux - General 4 11-28-2006 08:01 PM
moving /home /root & /var to new partition CrashedAgain Linux - General 8 11-24-2005 10:44 AM
Moving /var/adm and /var/lib - why does it hurt? J_Szucs Linux - General 1 09-15-2004 06:46 PM
Moving contents of /var to separate partition TexasDex Linux - Software 2 03-01-2004 08:30 PM
Moving /var to new partition burnpile Slackware 2 12-10-2003 12:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:59 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