Problem in moving home folder

Asked by Alshaimaa

Hi everyone....

When i first install ubuntu, i made a home folder with a space 35GB, and root with 16GB...
and after short time i found that my root partition is nearly full.. and discovered that all my downloads are saved in a folder "/home" in the root partition...

i tried this link to move my home folder to its partition http://ubuntu.wordpress.com/2006/01/29/move-home-to-its-own-partition/
but when i entered this command "$mkdir /mnt/newhome"
i got this error "bash: /mnt/newhome: No such file or directory"
and when i entered the second line "$sudo mount -t ext3 /dev/sd9 /ment/newhome"
i got this error "mount: mount point /ment/newhome does not exist"

Could anyone help me please...
Many thanks in advance...

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Jim Hutchinson
Solved:
Last query:
Last reply:
Revision history for this message
Jim Hutchinson (jphutch) said :
#1

I don't know anything about that how to or moving /home. But I do know why you are getting those errors. The first one needs to be

sudo mkdir /mnt/newhome

You can use something for "newhome" other than "newhome". For example

sudo mkdir /mnt/downloads

The second command has some typos. Try

sudo mount -t ext3 /dev/sd9 /mnt/newhome

or

sudo mount -t ext3 /dev/sd9 /mnt/downloads

depending on what you named that directory.

Revision history for this message
Jim Hutchinson (jphutch) said :
#2

Oops, I made a typo correcting your typo :)

The mount command needs to be

sudo mount -t ext3 /dev/sda9 /mnt/newhome

However, the sda9 part depends on your actual hard drive set up. I'm just going by what you have above and guessing. If that doesn't work, paste the output of

sudo fdisk -l

here and we can determine the actual partition name.

Revision history for this message
Alshaimaa (shofashion) said :
#3

Hi dear..

Many thanks for the help... now i found that one of the errors was partition name.. it was sda8 not 9 ..
sorry for that... (i discover that from the command you game me ..)

but it still not working... as after the command "$cd /home/
$find . -depth -print0 | cpio –null –sparse -pvd /mnt/newhome/".. i got another error which is
"bash: .: -d: invalid option
.: usage: . filename [arguments]
cpio: You must specify one of -oipt options.
Try `cpio --help' or `cpio --usage' for more information."... and i found that i lost all my home folder...

and i didn't know what happened yet...

Thanks dear for the help...
hope i could fix it...

Revision history for this message
Jim Hutchinson (jphutch) said :
#4

I'm afraid I don't know how the cpio stuff works. However, the "null" and "sparse" commands should have two dashes in front. That may be the problem. So the line should look like this...

find . -depth -print0 | cpio --null --sparse -pvd /mnt/newhome/

You could also try

sudo cp -a /home/* /mnt/newhome

to move the files but I'm not sure how that deals with links. It may not be a big problem. When this is done, I suspect there may be some permission problems. I think root is going to own /mnt/newhome so you may find that in the end root owns your files too. I don't see any mention of this as a problem so maybe not but if so, you can set yourself as owner again with

sudo chown -R username:username /home/username

being sure to substitute your username for "username" above.

Revision history for this message
Alshaimaa (shofashion) said :
#5

Many thanks dear...
i already lost all my old hope and re-install ubuntu... so i create a hope from the begining..,:)

But i trted your command "sudo chown -R username:username /home/username" with my username of course.. and i got this error
"chown: missing operand after `alshaimaa:alshaimaa/home/alshaimaa'
Try `chown --help' for more information."...

I really feel hopeless with the terminal..:(
Many thanks dear for replying...

Revision history for this message
Alshaimaa (shofashion) said :
#6

i got a spelling mistake above.. sorry
*so i create a home from the beginning

Revision history for this message
Best Jim Hutchinson (jphutch) said :
#7

You are missing a space in the chown command. Instead of

chown -R alshaimaa:alshaimaa/home/alshaimaa

try

chown -R alshaimaa:alshaimaa /home/alshaimaa

with a space before the /home. However, you don't need to do this on a new install. I was only showing you this in case moving all your files to the new /home resulted in ownership changes.

Sorry you didn't have good luck moving /home but to be honest setting it up from scratch is probably the best and easiest way to go.

Revision history for this message
Alshaimaa (shofashion) said :
#8

Aha,, now i got it...:)

Million thanks dear...
and yup.. its easiest way to set a home from scratch...but i lost my data.. :cries:..

Anyway Many thanks again dear for the great help... and have a nice day... :)

Peace...

Revision history for this message
Alshaimaa (shofashion) said :
#9

Thanks Jim Hutchinson, that solved my question.

Revision history for this message
Jim Hutchinson (jphutch) said :
#10

Glad I could help.