PDA

View Full Version : moving /home from /dev/hda to /dev/sda ?



spfdz
11th May 2006, 06:10 PM
Can anyone tell me how I can achieve this? My /dev/sda has hardware raid mirror so I'd like to place it there for a backup.

Thanks.

edit: I forgot to mention, I would like it perminently mounted as well. Would I then edit fstab?

William Haller
11th May 2006, 06:30 PM
Say your mirror is mounted on /ub. As root, you could do something like the following....

# Go to the main root directory
cd /
# Make a tarball of your home files
tar cvf home.tar home
# Copy the tarball to the new target directory
cp home.tar /ub
# Go there
cd /ub
# Extract the files from the tarball
tar xvf home.tar
# Verify that everything got there (you can use du to count blocks but
# be really sure there weren't problems)
cd /
# Get rid of the old files
rm -rf /home
# Make a link to the new location from the old
ln -s /ub/home /home

Disclaimer - If you do a fresh install of Fedora, it will make a new /home and you'll have to recreate the symbolic link when it is done. An upgrade may possibly complain about having the link but will probably be OK. At least the FC4 to FC5 didn't seem to have issues for me. I don't have a RAID configuration, but I do have multiple disks with a similar setup.

Edit fstab to mount your RAID array to your preferred mount point. After you have run through all your apps and are comfortable everything is working, delete the old /home.tar and /ub/home.tar tarballs.

spfdz
11th May 2006, 09:43 PM
I've formatted the drive. And added this to fstab.
LABEL=/1 / ext3 defaults 1 1
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
LABEL=SWAP-hda5 swap swap defaults 0 0
LABEL=storage /storage ext3 defaults 1 1

I restarted, and there's no /storage directory there so I'm assuming I did something wrong. When I formatted the drive, I labeled it as storage and it's on /dev/sda1. (300GB 1 Partition)

Any ideas?

I want it to go /storage/home/spfdz


edit: figured it out, /dev/sda1 /mirror ext3 default 0 0 (changed folder name)

spfdz
13th May 2006, 06:25 AM
I created a sym link

ln -s /mirror/home /home

I notice when I do
cd /
cd home
cd home
cd home
cd home

It keeps going into an endless link? my home directory does appear there (spfdz) but also home is there, and if I go into it, it's just the same directory but furthur in the tree. Should it be like this or am I doing something wrong?