LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 10-05-2008, 12:51 PM   #1
gothicbob
Member
 
Registered: Sep 2005
Location: Birmingham / Bath Uk
Distribution: Kubuntu 8.10, Debain 4.0
Posts: 86

Rep: Reputation: 16
/home directory in fstab


I have my first harddrive with two of the partitions for / and /home
this looks like the following:

Code:
# /dev/sda5
/dev/sda5 / ext3 nouser,defaults,errors=remount-ro,atime,auto,rw,dev,exec,suid 0 1
# /dev/sda6
/dev/sda6 /home ext3 nouser,defaults,atime,auto,rw,dev,exec,suid 0 2
What I want to do is move my /home directory to another one of my harddrives. First I tried doing this by making a link from /home to /media/x/home however this just caused my computer to stop after typing in my username.

I found something that I could use. Using "mount --bind /media/x/home /home" would work but I was hoping to put it in my fstab. Is there a way to link an already mounted folder to the /home directory in fstab? or is there a much simpler way of doing what I'm trying to achieve?

Thanks in advance, sorry if I haven't been clear enough.

p.s. I don't want to make a new partition on the other drive, just have the home folder siting in it (its ext3 already)

Last edited by gothicbob; 10-05-2008 at 12:53 PM. Reason: p.s
 
Old 10-05-2008, 12:55 PM   #2
arckane
Member
 
Registered: Sep 2005
Location: UK
Distribution: Gentoo/Debian/Ubuntu
Posts: 307

Rep: Reputation: 38
Code:
# /dev/sda5
/dev/sda5 / ext3 nouser,defaults,errors=remount-ro,atime,auto,rw,dev,exec,suid 0 1
# /dev/sda6
#/dev/sda6 /home ext3 nouser,defaults,atime,auto,rw,dev,exec,suid 0 2
move current home to whichever location you want then do:

ln -s /path/to/new/home /home

Job done.
 
Old 10-05-2008, 12:58 PM   #3
gothicbob
Member
 
Registered: Sep 2005
Location: Birmingham / Bath Uk
Distribution: Kubuntu 8.10, Debain 4.0
Posts: 86

Original Poster
Rep: Reputation: 16
that what I tried first, and kde just didn't load after typing in my password....

I'll try it again though
 
Old 10-05-2008, 01:00 PM   #4
arckane
Member
 
Registered: Sep 2005
Location: UK
Distribution: Gentoo/Debian/Ubuntu
Posts: 307

Rep: Reputation: 38
Hmm, you could try hard linking it but it definitely works in Solaris.

You do have the other drive mounted on something in fstab, right?

example: /dev/sdb1 /mnt/stuff

It also has to be automounted and available once you get to the login prompt
 
Old 10-05-2008, 01:30 PM   #5
gothicbob
Member
 
Registered: Sep 2005
Location: Birmingham / Bath Uk
Distribution: Kubuntu 8.10, Debain 4.0
Posts: 86

Original Poster
Rep: Reputation: 16
Right I just tried it again here are my steps:

Console login
Copy contents of /home to /media/x/home
replace /home with "ln -s /media/x/home home"
comment out the mounting of /dev/sda6 to /home in the fstab
restart

When I login it says "could not start ksysconfig" or something. Not quite sure what is wrong...

/media/x is in the fstab and is mounted fine, as I can access the files during the console login.
 
Old 10-06-2008, 09:28 AM   #6
arckane
Member
 
Registered: Sep 2005
Location: UK
Distribution: Gentoo/Debian/Ubuntu
Posts: 307

Rep: Reputation: 38
OK, so now hard link it:

Code:
rm /home
ln -T /media/x/home home
How does that work out?
 
Old 10-06-2008, 05:51 PM   #7
NVRAM
LQ Newbie
 
Registered: Oct 2004
Location: Western USA
Distribution: Fedora,Suse,Redhat,Puppy,etc.
Posts: 13

Rep: Reputation: 1
If you log in as root on the console what do you see for:
ls -l /home
ls -l /home/
mount


Can you log in as your non-root user at the console? (Use Ctrl+Alt+F1)

How did you "Copy contents of /home to /media/x/home"? Did the command copy all files and retain their permissions?
 
Old 10-06-2008, 06:19 PM   #8
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,275

Rep: Reputation: 126Reputation: 126
Did you actually copy the contents of the old /home to the new /home? If not, given where you are, it's probably best to do it in maintenance mode before everything comes up. Just mount the old /home somewhere and the new /home somewhere else. Run "cp -axu /oldhome/ /newhome". Once the files are copied over, then you can redo your /etc/fstab and reboot.
 
  


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
contents of 'home' directory found at sda5: mounted as /home, and also on sda6:/home leswatson Linux - Newbie 4 04-18-2008 05:02 PM
restoring desktop directory in /root (or any home directory) mel_lai Linux - Newbie 3 02-04-2008 04:13 AM
Active Directory User Cannot Write to Samba Home Directory jonwatson Linux - Networking 2 12-19-2006 01:40 PM
Apache Root/Home Directory and setting up FTP for home directories? Mankind75 Linux - Newbie 6 07-23-2006 03:37 PM
How to protect a file/directory in your home login directory (RH Linux) jitsenho Linux - Security 9 07-04-2006 12:08 AM


All times are GMT -5. The time now is 05:07 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration