[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Moving Home folder

Posted on 2003-11-04
10
Medium Priority
?
724 Views
Last Modified: 2011-08-18
Hi,

Ok im very new to linux.. so this will probally be a easy question...

My home folder was on a small partition on mt system, it filled up very quickly...
I would like to move it to a larger partition without affecting anything...

df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda1              36G  6.7G   27G  20% /
/dev/hda3             387M  9.3M  357M   3% /home
none                  251M     0  251M   0% /dev/shm
AFS                   8.6G     0  8.6G   0% /afs
[drivers@localhost drivers]$

I would like to put my home directory onto /dev/hda1.  any advice would be appreciated.

Cheers
0
Comment
Question by:mrorange
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 18

Expert Comment

by:liddler
ID: 9678044
user usermod -d /path/to/new/home username
or simply edit the /etc/passwd file to reflect the new path, then use mv to move the files
0
 
LVL 1

Accepted Solution

by:
mr_rabit earned 400 total points
ID: 9678081
just copy the directory to /home2
cp /home /home2 -R

then unmount /home
unmount /home

check if /home still exist
if yes then  check if there is something in this directory
ls -al /home
if there is nothing in /home then remove /home
rm /home -Rf

if there are files then the unmount was not succesfully
try it again

edit the fstab but first backup this file
cp /etc/fstab /etc/fstab.org

vi /etc/fstab

remove the line with /dev/hda3 or /home

then check if after reboot the /home is recreated
do this like :

mount -a
and check if /home exists
if yes post a reply

if not you can cp the /home2 directroy to /home
cp /home2 /home -R


and your finisched

if it works all oke an even after a reboot you can remove /home2
rm /home2 -Rf

there will always be a backup on /dev/hda3 if the unmount was oke

good luck

mr_Rabit



0
 
LVL 1

Author Comment

by:mrorange
ID: 9678456
I am at the stage of removing the lines you suggested from my fstab file.
This is what it contains...

LABEL=/                 /                              ext3    defaults        1 1
none                          /dev/pts                devpts  gid=5,mode=620  0 0
LABEL=/home      /home                     ext3    defaults        1 2
none                         /proc                       proc    defaults        0 0
none                        /dev/shm                tmpfs   defaults        0 0
/dev/hda2               swap                       swap    defaults        0 0
/dev/cdrom              /mnt/cdrom           udf,iso9660 noauto,user,owner,kudzu,ro 0 0
/dev/hde1               /mnt/camera           auto    noauto,owner,kudzu 0 0

Which line should i be editing, and out of curiosity how does this put the home directory onto the HDA1

Cheers
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 1

Author Comment

by:mrorange
ID: 9678680
When i rebooted the line that I deleted in fstab was not recreated, i presume the mount -a mounts everything in the fstab file...

:-S

0
 
LVL 9

Expert Comment

by:majorwoo
ID: 9679337
yes, mount -a does mount everything in /etc/fstab
0
 
LVL 1

Author Comment

by:mrorange
ID: 9679493
Ok, so by following the suggestion from Rabit i have still not been able to change my Home directory..

So any other ideas how I mount the home directory on on my HDa1

Cheers
0
 
LVL 9

Assisted Solution

by:majorwoo
majorwoo earned 200 total points
ID: 9679649
sorry, i didn't read the whole thing, i just answered the question I saw at the end.

It's really painless

#copy the existing home
cp -a /home /home2

#unmount the old home
umount /home

#comment the following line out in /etc/fstab by putting a # in front of it
#/dev/hda3             387M  9.3M  357M   3% /home

#Now make the new home directory
mv /home2 /home


All set now...

0
 
LVL 9

Expert Comment

by:majorwoo
ID: 9679666
sorry, pasted the wrong line, comment out this line from /etc/fstab

LABEL=/home      /home                     ext3    defaults        1 2

put a # in front of that, so

#LABEL=/home      /home                     ext3    defaults        1 2
0
 
LVL 1

Expert Comment

by:mr_rabit
ID: 9680017
thats what i told too

but what is the problem at the moment??

you don't have to mount any more we now made a directroy on the / (root partition) that is /dev/hda1

so everything should work now.

tell me more what the problem is

greetz mr_rabit





0
 
LVL 1

Author Comment

by:mrorange
ID: 9680115
Thanks  guys, it all work great now... i guess  i just need a little clarification there...


Cheers again...


Regards,


Dan
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question