Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am running Novell Suse Desktop Enterprise. I have two hard drives in my system. Linux is installed on the first hard drive and the second hard drive is setup for extra storage. I would like to move my home directory to the second hard drive in case something should go wrong with the hard drive that linux is sitting on I will still have the files in my home directory sitting on the second hard drive. Im sort of new at this. any help would be appreciated.
This is actually pretty straight-forward. You want to mount the new drive to a temporary location (say like /mnt/temp_home). Once you've got it mounted, copy over everything from your current /home directory to the temporary one. Once that is completed, you'll probably need to edit your /etc/fstab file so that the new drive gets mounted to /home. I have a similar set-up (/home is on a separate hard driver from the rest of linux) and my fstab entry looks like this:
/dev/hdd1 /home reiserfs defaults 1 2
Of course you'll need to modify that to match your file system and device name.
If you re-boot and everything looks good, you can then mount your old /home to a new mountpoint (like /mnt/temp_home) and delete the files. You could also then re-distribute the space to Linux.
Create a linux partition on the second HD and copy files from your existing home directory to it. Now mount the partition on your second hard disk on the /home directory.
# mount /dev/hdb1 /home
(Replace hdb2 with the partition name on 2nd HD)
To ensure this happens automatically every time you boot, include an appropriate line in your /etc/fstab file.
Quote:
/dev/hdb1 /home reiserfs defaults 1 2
Ofcourse, replace hdb1 with the partition name on 2nd HD and replace reiserfs with the type of file system you formatted this partition with.
If none of this makes much sense, come back and say so.
EDIT: Oops ! Lookz like Hangdog42 beat me to it. Ignore this !
I would like to move my home directory to the second hard drive in case something should go wrong with the hard drive that linux is sitting on I will still have the files in my home directory sitting on the second hard drive.
Hopefully nothing will then go wrong with the second hard drive that your /home is sitting on!
Sounds like you're worried about your data, and this is good. Now is the time to implement a backup plan ... before you need it. If you end up moving your /home to the second drive, back it up regularly to the first hard drive. If you have access to another computer on your network, backing up to a totally seperate computer is even better than to another hard drive on the same computer. Or you could backup to CDs/DVDs instead (or in addition to).
Well, I tried some of your suggestions and well IT WORKED !! I had originally set up sdb1 mounted in the following way:
/dev/sdb1 /data reiserfs acl,user_xattr 1 2
so here is what I did:
1. created a temporary directory labeled temp-home and moved all items in my home folder to the temp-home folder.
2. opened up a terminal windows and switched user to root. then typed
# mount /dev/sdb1 /home
;3. opened fstab as root and changed
/dev/sdb1 /data reiserfs acl,user_xattr 1 2
changed to:
/dev/sdb1 /home reiserfs acl,user_xattr 1 2
and deleted the previous /home entry.
4. at this point I messed up and rebooted without moving the files from temp-home to the new home directory. No worries, boot into failsafe and move them over through there.
AND, yes I do worry about my data I always like to keep it on a different drive. and I do backup alot. I used to practice this in a windows enviroment and since Im working on switching over I figured this practice would keep me safe until I become more literate with linux.
Congrats! Probably the best reason to keep /home on its own partition is that if you need to re-install Linux (or simply want to try a different flavor) you don't have to worry about losing your /home directory. Once you get the system back up and running, all your files (and customizations) will be there.
I don't understand what benefit you feel you've gained by putting your data on a different drive from the OS. I can understand putting /home in a different partition in case you need to reinstall the OS, but putting it on a different drive more or less doubles your chances of needing to perform annoying recovery to get the system back up.
Now, if you developed this habit with Windows I can sort of understand. Older versions of Windows would only install onto the whole drive, so even data in a different partition would have to be wiped to do a clean reinstall.
I don't understand what benefit you feel you've gained by putting your data on a different drive from the OS. I can understand putting /home in a different partition in case you need to reinstall the OS, but putting it on a different drive more or less doubles your chances of needing to perform annoying recovery to get the system back up.
Now, if you developed this habit with Windows I can sort of understand. Older versions of Windows would only install onto the whole drive, so even data in a different partition would have to be wiped to do a clean reinstall.
The reason listed above by HangDog pretty much says it all, the fact that it is a different drive and not a partition is basically a luxury of having another drive. Also, if a drive fails and the drive is partitioned you loose everything. If a drive fails and you have your data on another, all you loose is your OS installation
Last edited by FrodoTeeBagins; 07-24-2006 at 03:18 PM.
HD 1 (Part.1 = OS, Part.2 = Data) Craps Out
Im F*****, unless I backed up both
Why?
You apparently have backed up the data, right? And you apparently would rather reinstall the whole OS than bother keeping a backup of the OS.
So, if your OS and data both "crap out", then you just:
1. Replace the drive.
2. Install the OS.
3. Restore from the last backup.
Yippee! No problem! Instead of two steps, you have to do three steps. Big deal! If you're already dealing with an annoying recovery, what's one extra step? You've roughly halved your chances of needing to do the annoying recovery in the first place.
Alternatively, you could put an OS partition on both of the drives, and put data partitions on both of the drives. Then you use rsync and/or RAID1 arrays to make the second drive backup the first. In that case:
1. The first drive fails--then you remove it and switch channels on the first drive. Yippee!
2. The second drive fails--then you remove the second drive. Yippee!
3. Both drives fail--then you buy a new drive, install the OS, and restore your data from backup. Annoying, but not very likely.
I fail to see any reason why your method is preferable. It merely increases the chances that you'll need to perform an annoying repair.
Yippee! No problem! Instead of two steps, you have to do three steps. Big deal! If you're already dealing with an annoying recovery, what's one extra step?
Well perhapse in your world one extra step is no big deal. But im my job one extra step is one to many. Have fun with your one extra step.
Quote:
Originally Posted by IsaacKuo
I fail to see any reason why your method is preferable. It merely increases the chances that you'll need to perform an annoying repair.
my method is preferable because its the way I want to do it. we should run a poll to see how many others want to add another step. Thanks to all for the help it is greatly appreciated.
Last edited by FrodoTeeBagins; 07-25-2006 at 08:14 AM.
If one extra step is too much, then you should really rsync and/or RAID1 to mirror the OS and data on the two drives. Then there's only one step, and if the drives are hot-pluggable there's potentially not even any downtime.
You do understand that by making either drive a point of failure, you're roughly doubling the chances of a failure, right?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.