LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   RedHat 9 - add new disks to server (https://www.linuxquestions.org/questions/linux-newbie-8/redhat-9-add-new-disks-to-server-238197/)

pupton 10-03-2004 09:28 AM

RedHat 9 - add new disks to server
 
Setup Redhat 9 on a 10gb disk. I have a spare set of 60gb disks that I would like to install in this server, mirror and move my home folder to the new disks.

Any pointers???

adamwenner 10-22-2004 03:09 PM

mirroring i dont know about, but i do know about copying your home directorys to a new partition:

install the new disks on your machine, then check to see where you have them installed, for instance, you can list your /etc/fstab file and look at what harddrives are connected, and look at which ones are also by doing df-h

any harddrives listed either of those places are not connected (most likely)

therefore your new harddrives are at the next addresses

hda1

this is harddrive 1 on the primary IDE cable

hdb1
is the first harddrive on the secondary ide cable

once you know their addresses on the box, make a directory in the /mnt folder

mkdir /mnt/temp

then run the following command, substituting the harddrives address at the end
fdisk /dev/hda1
then specify the partition size and such there, not too hard
make sure to save your fdisk using the "write out" or somthing like that (i think its w at the fdisk prompt)

reboot your machine when you are done running fdisk on all of your drives

then format the drives using either the ext2 or ext3 filesystem (either will work, and there isnt much difference as far as performance or anything)

/sbin/mkfs.ext3 /dev/hda1

(remember to substitute hda1 for whatever your harddrive address actually is)

then mount one partition that you want to make the /home directory to /mnt/temp

mount /dev/hda1 /mnt/temp

then copy the information from the home directories to the new harddrive temporarally mounted at /mnt/temp

cp --preserve=ownership -r /home/* /mnt/temp
(if you are running this as root and it starts asking you "descend into directory", do control+c and type in "unalias cp", then try again)

after this is done, verify it was copied correctly, under the /mnt/temp should be

user1/
user2/

(whatever the usernames are)

then remove the stuff from the current /home directory by running
rm -r /home/
(if you are running this as root and it starts asking you "descend into directory", do control+c and type in "unalias rm", then try again)

then unmount /mnt/temp by running
umount /mnt/temp

then open up your /etc/fstab file with an editor (edit or nano are good ones that i use)

and go to a new line and add the following (note (tab) needs to be substituted for a tab and hda1 needs to be substituted too)

/dev/hda1 (tab) /home (tab) auto (tab) defaults (tab) 1 (space) 1

then run
mount /home
and cd /home

do an ls and see if everything worked out ok
one thing to check is the permissions and owners of folders and such

if you get no errors on mounting and things like that, then your perfect

restart to make sure of no problems, and your done


All times are GMT -5. The time now is 03:35 AM.