LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-20-2005, 02:40 PM   #1
DraaX
Member
 
Registered: Jul 2003
Location: B.C. Canada
Distribution: Debian Jessie
Posts: 95

Rep: Reputation: 15
Any way to change what partitions /home is on without reinstalling?


Hey slackers.

I am just curious if there is any way to change which partition my /home directory is on without reinstalling. I put my /home directory on a partition with very little space and want to put it onto the same partition as my root directory. Is this possible without a reinstall?

Thanks in advance.

draAx

Last edited by DraaX; 02-20-2005 at 03:20 PM.
 
Old 02-20-2005, 03:33 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,324

Rep: Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905
Sure,
As root, unmount /home and mount it somewhere else like /mnt/oldhome. Using the cp command
cp -dpR /mnt/oldhome/* /home/
 
Old 02-20-2005, 03:58 PM   #3
DraaX
Member
 
Registered: Jul 2003
Location: B.C. Canada
Distribution: Debian Jessie
Posts: 95

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by michaelk
Sure,
As root, unmount /home and mount it somewhere else like /mnt/oldhome. Using the cp command
cp -dpR /mnt/oldhome/* /home/
Excellent, this sounds like what I want to do. I will try this as soon as I get home.

Will this command make sure that my /home remains on the other partition even after a reboot?

Thanks a billion

draAx
 
Old 02-20-2005, 04:16 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
No, you'll need to edit /etc/fstab to give the correct location of the new partition to be mounted as /home.
 
Old 02-20-2005, 04:20 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,324

Rep: Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905Reputation: 1905
Oops... btmiller is correct I forget a step. But all you need to do is delete the entry in the /etc/fstab file for the /home partition. Since your copying the files to the / partition you do not need another entry.

If you remove the /etc/fstab for /home the original data will remain intact. You can always mount it to another directory.
 
Old 02-20-2005, 04:23 PM   #6
coffeedrinker
Member
 
Registered: Sep 2003
Posts: 173

Rep: Reputation: 30
You can also move it and then link it. FreeBSD did this (does this?) by default (back when I used it).

So you could mount your other drive/directories anywhere you wanted and then make links in /home to the whole thing or particular users directories.

I did something like this once for ftp on a separate drive.
 
Old 02-20-2005, 07:53 PM   #7
DraaX
Member
 
Registered: Jul 2003
Location: B.C. Canada
Distribution: Debian Jessie
Posts: 95

Original Poster
Rep: Reputation: 15
Thanks for the replies!!

So if I understand this correctly I should copy my whole /home folder to say /mnt/homeold by using the command

Code:
cp -dpR /mnt/homeold/* /home/
Then I should remove the /dev/hda6 from my fstab below:

Code:
/dev/hda8        swap             swap        defaults         0   0
/dev/hda7        /                reiserfs    defaults         1   1
/dev/hda6        /home            reiserfs    defaults         1   2
/dev/hda1        /win-c           vfat        defaults         1   0
/dev/hda5        /win-d           vfat        defaults         1   0
/dev/hdc         /mnt/cdrom subfs fs=iso9660  users,ro         0   0
/dev/cdrom       /mnt/cdrw subfs fs=iso9660   users,ro         0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
Now what should I do so my data in /mnt/homeold is recognized as being in /home?
 
Old 02-21-2005, 01:01 AM   #8
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,874

Rep: Reputation: 554Reputation: 554Reputation: 554Reputation: 554Reputation: 554Reputation: 554
remove or comment out the line for /dev/hda6 so that the data you see is what is in /home and not that in /hda6
 
Old 02-21-2005, 12:32 PM   #9
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
type:
man fstab
 
  


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
reinstalling without losing /home/user directory? santaliqueur Linux - Software 3 11-16-2005 10:25 AM
question about reinstalling without losing data on seperate partitions? Lleb_KCir Linux - General 4 04-18-2005 03:10 AM
keep data in home slice when reinstalling xtra Linux - Newbie 6 07-09-2004 06:42 AM
mount / , /home , /home/usr on different partitions alekoos Slackware 14 05-03-2004 12:39 PM
mounting other partitions to /home mcd Linux - Newbie 4 08-28-2003 07:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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