LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 03-29-2011, 01:27 PM   #1
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Rep: Reputation: 15
move /home to partition after install


how hard would it be to move the home directory? I think I would just create the new partition, then move the files over in run level 1, then reboot. will this work?

I have home on the root / partition right now, but I have extra disk space and would like to move it to its own partition without reinstalling the os. I'm using fedora 14, ext4.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-29-2011, 01:35 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Quote:
Originally Posted by mattsoftnet View Post
how hard would it be to move the home directory? I think I would just create the new partition, then move the files over in run level 1, then reboot. will this work?

I have home on the root / partition right now, but I have extra disk space and would like to move it to its own partition without reinstalling the os. I'm using fedora 14, ext4.
Dont forget a symlink!

But really,.. instead of using a drive as a seperate entity at all -- why not just add the new drive to your volume group and extend it onto the new drive? That way you are adding space that is transparent to programs.

Last edited by szboardstretcher; 03-29-2011 at 01:38 PM.
 
Old 03-29-2011, 03:28 PM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
how hard would it be to move the home directory?
It is not hard. It is quite fun
Quote:
I think I would just create the new partition, then move the files over in run level 1, then reboot. will this work?
Yes, and maybe no, until you do a few other steps:
  • Create the partition.
  • Format the partition.
  • Mount the new partition somewhere.
  • Copy your /home/* files to the new partition whilst you are not logged in as yourself, but as the root user. Use cp -a source dest so all file attributes are copied. Copying files whilst you are logged in is not a good idea, as they keep changing. This is best done by logging out of the GUI, and in again at a CRTL-ALT-F2 terminal. Login as root there. I know you are using fedora, but if you are using ubuntu (or derivatives, like Mint) you will have to enable the root login before you can do this.
  • Do not delete any files in the old /home/ just yet.
  • touch /new/home/mountpoint/NEWHOME so it is easy to see if it has been mounted correctly.
  • ls /new/home/mountpoint to make sure your users are listed properly: user1 user2 NEWHOME etc. Otherwise you did the cp wrong. Try again.
  • Adjust fstab so it will mount the new home partition at /home/

If this works after a reboot, and you can see the file NEWHOME, all is good.

If not, you still have your old /home/* "hidden" underneath the mountpoint of the new home partition. So boot from a live CD, restore fstab as it was, and try again.

If it did work you can safely (as root) unmount the new home partition (so the old files become visible again - Check: NEWHOME should not be visible) and delete all those files, so there is more space on your / partition.

Best to make a backup before you start if you want to feel safe.

Have fun & let us know how you get on.

LVM is an alternative, but when it goes wrong, it seems to be very difficult to recover. I'd rather not go there.

Best wishes.
 
2 members found this post helpful.
Old 04-01-2011, 09:24 AM   #4
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by tredegar View Post
It is not hard. It is quite fun
thanks for the help. great instructions. you covered things I didn't even think of.
 
  


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
Can I move /home partition under root partition arijit_2404 Linux - General 3 07-05-2007 12:01 AM
How to move /home to new partition frazelle09 Ubuntu 12 05-02-2007 09:22 PM
How do i move /home to a new partition? glenn69 Linux - General 8 06-25-2004 11:38 AM
Partition Free Space - Move /home to the new partition gregkise Linux - General 5 12-16-2003 10:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

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