LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 11-22-2003, 01:46 PM   #1
londonboi
Member
 
Registered: Jun 2003
Location: London
Distribution: Debian (unstable Branch) 2.6 Kernel
Posts: 71

Rep: Reputation: 15
Moving /home to a new HD poss hdb1


Hi, I am going to be buying a 100GB HD soon as my current one is starting to run out of space! Now what i would like to do is home the whole /home directory to hdb1.

I want to do this without effecting any of my settings and want to to happen as smooth as possible! Can anyone lend any insights as to how i may do this and having hdb1 to mount automatically..... im not too good with fstab file at the moment so any help would be much apreciated
 
Old 11-22-2003, 02:13 PM   #2
fsbooks
Member
 
Registered: Jan 2002
Location: Missoula. Montana, USA
Distribution: Slackware (various)
Posts: 464

Rep: Reputation: 52
This differs slightly depending on if your /home is now a separate partition, or included in /. Posting your fstab will get a better answer if this does not work, but basically you make your new partition in a temporary location (/mnt perhaps), copy the current /home to the new one (either use for example "cp -a /home /mnt/home", or something like "rsync -acvSx /home/ /mnt/home" or a variety of other commands -- someone probably has a good link for options), either modify your old fstab entry or add it in (if new) to read "/dev/hdb1 /home ext3 defaults 1 2" (assuming of course you use the ext3 filesystem). If you have a current /home partition, umount it and mount up the old and test it out. If /home is part of /, just mount it on top first for testing. Later assuming all goes right, you can umount the new /home and get rid of the of files.

I think that is it.
 
Old 11-22-2003, 02:15 PM   #3
londonboi
Member
 
Registered: Jun 2003
Location: London
Distribution: Debian (unstable Branch) 2.6 Kernel
Posts: 71

Original Poster
Rep: Reputation: 15
Hey Thanks for your responce. I will try this in a few days once the HD arrivies. Just to note tho then /home is located on the same partition as / so both are on hda1

I will let you know what happens

Cheers
 
Old 11-22-2003, 02:46 PM   #4
fsbooks
Member
 
Registered: Jan 2002
Location: Missoula. Montana, USA
Distribution: Slackware (various)
Posts: 464

Rep: Reputation: 52
Sounds good. Just check and double check everything you are doing three times. Make and write down a plan. Proofread your command line carefully before hitting return. Moving a directory tree to a new location is simple, but can be disaster with a small mistake. The important thing is to maintain all ownership and permissions, maintaining proper links, and generally not crossing filesystem boundaries. If you use rsync, you may consider adding the -H option to preserve hard links if you have them. Don't forget to read the man pages and do not take any command for granted.

The simplist way of course to accomplish your task is:

mv /home/* /mnt/home
umount /home
umount /mnt/home
(modify fstab)
mount /home

However, I don't recommend this because if something does go wrong, you may be out of luck. If you have a way to backup /home to another location before any of this, that of course would not hurt at all :-)

Oh, and sorry for the disruption our imperial non-elected president has brought to your fair town.
 
  


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
how to use /dev/hdb1 for /home/user1 malaka56 Linux - Software 1 10-22-2005 07:02 PM
need help moving home shaggystyle Linux - Hardware 15 09-01-2004 12:31 AM
moving /home to / abu_abdullaah Linux - Newbie 3 07-18-2004 01:15 PM
Moving /home xodeus Slackware 7 10-06-2003 03:33 PM
Moving /home to a new harddrive vwaldoguy Linux - Hardware 1 05-26-2003 03:37 AM

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

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