LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-24-2004, 01:00 PM   #1
glenn69
Member
 
Registered: Jul 2003
Location: Chicagoland
Distribution: ArchLinux
Posts: 261

Rep: Reputation: 32
Question How do i move /home to a new partition?


I have RH9, went with the default partitions. I think they are swap, /, and /boot with nothing more.

I recently deleted a windows partition on a second drive with about 10 GB space. I would like to know how I go about setting my /home to that new partition.

Step by step would be helpful

Do i copy files first then do something with the mount?

Thanks
 
Old 06-24-2004, 01:12 PM   #2
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
Have a look at Partitioning in action: Moving /home and let me know if it worked
 
Old 06-24-2004, 07:27 PM   #3
glenn69
Member
 
Registered: Jul 2003
Location: Chicagoland
Distribution: ArchLinux
Posts: 261

Original Poster
Rep: Reputation: 32
Well it worked...pretty much.

I followed the steps ok until I got to step 6 where the instructions read if you have /home in a dedicated partition already follow step 6a otherwise follow step 6b. Well I needed step 6b, however it is not labeled anywhere, nor do the links go to step 6b. So I had to figure out where in the middle of step 6a that 6b started. I'm pretty sure I guessed wrong (I started at Then, unmount and remount the new partition: ) I did that then exited single user mode then tried to follow the remaining steps and when I tried mv /home /home.old I was greeted with an error about the partition already being used or something.

My /home does work now on the new partition, however I'm not really sure "where" the original copy of /home files are. I did not have a chance to delete them, because I can no longer access them. I don't know where they are.

So thanks for the help. If anyone can tell me where my original /home files are, I would appreciate that so they don't just sit there eating up disk space.


Thanks again
 
Old 06-24-2004, 08:01 PM   #4
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
More than likely, it's still on your original partition. When you mount a filesystem onto a pre-existing directory, the new mount takes precedence. Here's an example to illustrate what I'm getting at...

Suppose I have a directory layout like this:
Code:
/home/me
       |- documents
       |- downloads
       \- mnt
            \- floppy
                 \- test-dir
Now, let's say I have a floppy with this structure:
Code:
/
|- code
\- images
If I were to execute: mount /dev/fd0 /home/me/mnt/floppy
I would get this structure:
Code:
/home/me
       |- documents
       |- downloads
       \- mnt
            \- floppy
                 |- code
                 \- images
The point is test-dir gets replaced by the contents of the floppy. When I unmount the floppy, test-dir will "reappear". I'm guessing that since you modified your fstab, that your new home partition is automatically mounted over your original /home, and is hiding the backup files you made. You could probably access it by unmounting your new home partition, and then examining the /home directory.

As a side note, whenever I want to move a filesystem, I usually boot off a rescue disc (like Knoppix) to prevent any user or system activity from interfering with the move, and then it's simply a straight copy from location A to location B, editing the fstab appropriately, and rebooting... No worse than going into single user mode in my opinion.
 
Old 06-24-2004, 09:44 PM   #5
glenn69
Member
 
Registered: Jul 2003
Location: Chicagoland
Distribution: ArchLinux
Posts: 261

Original Poster
Rep: Reputation: 32
I tried umount /home however the error reads device is busy.
I do not have any open windows of home so i am not sure how to proceed
 
Old 06-24-2004, 09:54 PM   #6
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Personally, I would use a distro like Knoppix, or some other sort of rescue-type of distro. If that's not an option, then I would suggest trying to boot into single-user mode again.

I'm absolutely positive you would be able to examine all of your partitions using Knoppix without running into any "in use" trouble. I'm not absolutely positive about single-user mode though. It can't hurt to try.
 
Old 06-25-2004, 03:37 AM   #7
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
would going into runlevel 3 ($ init 3) ve the same as going into single user mode?
 
Old 06-25-2004, 03:45 AM   #8
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Single-user mode is usually runlevel 1 ($ init 1)

Runlevel 3 typically set up to be a fully functional system running in command-line only

Runlevel 5 is tyically the exact same as 3 with the exception that X is started up automatically.

Each system can define how the runlevels behave, but those are the "normal" settings.
 
Old 06-25-2004, 11:38 AM   #9
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
Found this in the man pages:

Code:
 $ man mount:

Since  Linux  2.5.1  it  is  possible  to  atomically move a subtree to
       another place. The call is
              mount --move olddir newdir
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I move /home ? MikeyDIUP Linux - Newbie 3 09-11-2005 01:36 AM
How do I move /home to a new partition? glenn69 Linux - Newbie 2 01-05-2005 10:15 PM
how can I move my /home to anohther partition ? linjia Linux - Software 1 12-11-2004 11:07 AM
Partition Free Space - Move /home to the new partition gregkise Linux - General 5 12-16-2003 10:19 PM
Move /home to Windows Partition Campy19 Mandriva 2 11-23-2003 12:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:47 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
Open Source Consulting | Domain Registration