LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-20-2004, 10:28 AM   #1
johnmart
Member
 
Registered: Jun 2004
Location: Jakarta
Distribution: Kubuntu 7.04
Posts: 35

Rep: Reputation: 15
How do I install a new distro & save my Home?


I want to install a new distro, & am looking for assurance/advice on safeguarding my home files. I know I read a post about this some time ago, but I can't find it now.
Presently running Mdk 10, want to give redhat a try. I want to install RH over MDDK.
I have 3 linux partitions;
hda6 root
hda7 swap
hda8 home

Can I safely just install RH? Will it get rid of Mdk?

If this is covered in another post that you know of would appreciate a point in the right direction.
Thanks!!
 
Old 12-20-2004, 10:35 AM   #2
tangle
Senior Member
 
Registered: Apr 2002
Location: Smithville, TN
Distribution: Slackware
Posts: 1,745

Rep: Reputation: 71
It has been a real long time since I install Mandrake or Red Hat. But you should be able to mount the /home partition without formatting it.
 
Old 12-20-2004, 10:42 AM   #3
0pal_t0ad
Member
 
Registered: Feb 2004
Location: Southampton, England
Distribution: Laptop:Gentoo-i686-2.6.9-r9 Desktop:Slackware10 2.4.26
Posts: 298

Rep: Reputation: 30
most if not all distros will ask if u want to format the partitions, just say no for /dev/hda8
 
Old 12-20-2004, 02:26 PM   #4
Rick485
Member
 
Registered: Sep 2003
Location: Arizona
Distribution: Kubuntu 8.04
Posts: 202

Rep: Reputation: 30
If I understand correctly, I assume that you want to replace Mandrake with Red Hat. The other alternative would be to install Red Hat and keep Mandrake if you have enough hard disk space to do that.

So here is how to reuse your old home partition. When running the Red Hat install program, at some point you will be given three choices of what to use to partition your hard disk. The three choices are automatic partitioning, disk druid or fdisk. The disk druid choice would probably be easiest to use. Once inside disk druid you will be given a graphical picture of how your hard disk is partitioned. For each partition you can select a mount point and whether to reformat that partition or not. If you want to save the data on your hda8 partition then obviously you would not want to reformat that partition. You would also most likely want to select /home as the mount point for that partition. For hda6 you would probably want to select the reformat option for that partition and choose to have it mounted as "/". The swap partion could be reformated and mounted as a swap partition. The reformating and changes to your hard disk will not actually occur until you go on to the next step during installation.

In the next step I will assume that you only created a root user so far and have not yet created an ordinary user account for yourself with a login name such as John. I will also assume that under Mandrake you had probably logged in as John and had a home directory for John in /home/John. If so then once Red Hat is up and running you should still see a directory called /home/John. The question is now what to do with that directory? There are several choices. Do you want to just reuse that directory or do you want to create a new directory for youself which you would use when you log in as an ordinary user named John?

If you go to the /home/John directory (or whatever it is called) and then type "ls -a " you will most likely see some hidden file and directories that start with a period. In Linux hidden files start with a period. The "-a" in "ls -a" tells the ls command to also show the hidden files and directories. The question I have is if all those hidden files would be appropriate for Red Hat Linux or not. They would most likely not create any problems even if they do end up being reused although I am not totally certain about that. Some of those hidden files and directories control how various things are configured when ever you first log in as that user. If they exist in my /home/rick directory then some of them are used to configure things whenever I log in as rick. In my /home/rick directory there is a hidden directory called ".thunderbird" that controls how tbe Thunderbird e-mail program is confiured for me and also contains all of my old e-mail. Some of the other hidden files might configure things in ways that might or might not be ideal for Red Hat Linux although they probably would not be a problem.

So anyway, one option would be to use the useradd command to use the useradd commad to create a new ordinary user ID for yourself and either reuse that directory or not. Extra command line parameters would can be used to either reuse that directory or not. Red Hat probably also has a GUI tool that could also do that. If you do not reuse the directory then you could just copy the files to the newdirectory using the cp command. If you copy the files to the new directroy you probably would not want to copy most of the hidden files.

If your new user name happens to have a different user ID number and group ID number than what it had in Mandrake then you might not be the owner of your old files. You would then need to use the chown command to change the ownership of everything to whatever your current user name and group name are. You would need to lookup how to use the chown command.

Red Hat 9 was the last version of Red Hat. Red Hat has discontinued that and is no longer offering security patches for it. Fedora Core 3 is more or less the descendant of that product. Red Hat also still has their non-free verions of their products. When they discontinued Red Hat 9 I switched to Slackware although Slackware is probably a slightly more difficult distro for a beginner. Several members of the Linux Users Group in my town do use Fedora Core 3 and like it. For some reason Fedora Core 2 ran slowly on my computer and I never bothered to figure out why, I just used Slackware 10 instead. In the Linux+ certification class I took last fall at a local Community College we used Red Hat Linux.

I have Slackware 10, Red Hat 9, Vector Linux 9.0 and Windows 2000 all installed on this computer but mostly use Slackware. In my instructions above I assume that you want to replace Mandrake with Red Hat instead of keeping them both. If for some reason your hda8 partition did not get mounted as /home then it could be done manually by editing the /etc/fstab file. I hope I got all the details in the above instructions are correct.
 
Old 12-20-2004, 04:00 PM   #5
Rick485
Member
 
Registered: Sep 2003
Location: Arizona
Distribution: Kubuntu 8.04
Posts: 202

Rep: Reputation: 30
One other thought I have had on the subject it that whenever a new user is added a new partition is created for that user in the /home directory. If my username is rick a /home/rick directory is created (assuming that I am using the appropriate options with the useradd command). Whenever the new user is created along with their new home directory a copy of whatever is in the /etc/skel directory is copied to that new user's home direcotory. If I were to reuse my old /home/rick directory those hidden files from /etc/skel would not get copied to my old /home/rick directory. That probably would not really be a problem but is something to think about.

I have several versions of Linux on my computer and there is one partition that is mounted under /home/rick that I share among all three versions of Linux. It is mounted as /home/rick/stuff. In each version of Linux I made sure that I am using the same user ID number so that I would have ownership and the correct permissions no matter which version of Linux I happend to be using at the time. The hidden files are only in my /home/rick directory so the question of what is in my hidden files in /home/rick is was not an issue if something like /dev/hda10 was mounted as /home/rick/stuff.

Whenever I installed an extra copy of Linux, I did not bother mounting the shared /home/rick/stuff directory until later on. When I got around to making that change I just manually edited my /etc/fstab directory to mount the partiton wherever I wanted. Of course, I also had to create a /home/rick/stuff directory before the fstab file could mount the /dev/hdb10 partition there when ever I boot up.

I also copied my old .thunderbird directory to /home/rick before installing the Thunderbird e-mail program. That way as soon as I installed Thunderbird it would be using my old settings already be properly configured and still have all of my old e-mail in it. Notice that there is a period before the .thunderbird. I copied the .thunderbird directory recursively using the "-r" option with the cp command to get everything in every subdirectory. Only the configuration settings for Thunderbird were in the hidden directory not the actual program itself. Perhaps there were some other hidden files that would also have also been worth copying to my new /home/rick directory.

Last edited by Rick485; 12-20-2004 at 04:13 PM.
 
Old 12-27-2004, 01:31 PM   #6
johnmart
Member
 
Registered: Jun 2004
Location: Jakarta
Distribution: Kubuntu 7.04
Posts: 35

Original Poster
Rep: Reputation: 15
Hi Rick-Thanks for the quick reply. Sorry to be late responding, my Christmas week was multi-tasked. Fun but busy. I just now discovered that the post notification was junked by my junk mail controls. I quickly scanned your post & already see lots of helpful info--will dig into it, but wanted to say thanks & will get back after I've absorbed & tested your ideas.

I'm in Jakarta & there aren't many linux distros available here. Some PC dealers are selling linux loaded pc's for a good discount & Redhat is their distro. I had read articles about fedora core that made it look out of my experience reange for the time being. Slackware sounded interesting, but out of my depth for now too. I'm looking to change cuz mandrake is running well, & I want to try something new. I managed to get an older copy of knoppix & it ran lots faster than mandrake. Since it is a debian derivative maybe I'd give debian a try if I can find it.

Thanks again.
 
Old 12-27-2004, 01:38 PM   #7
johnmart
Member
 
Registered: Jun 2004
Location: Jakarta
Distribution: Kubuntu 7.04
Posts: 35

Original Poster
Rep: Reputation: 15
Oops--thanks also to tangle & opal_t0ad--helpful comments--just forgot to include your names. Tx!
 
Old 12-27-2004, 05:45 PM   #8
mugstar
Member
 
Registered: Jun 2004
Location: Scotland
Distribution: Anything that'll install...
Posts: 305

Rep: Reputation: 30
Man, it took me _months_ to work all that out for myself!! It seems like a lot of work, but it pays off big style.
Quote:
Originally posted by Rick485
Perhaps there were some other hidden files that would also have also been worth copying to my new /home/rick directory.
Definitely. The only ones I would avoid are the KDE and GNOME config directories. Different distros use different versions of these, and your desktop can get quite messed up.
 
Old 01-03-2005, 01:15 AM   #9
johnmart
Member
 
Registered: Jun 2004
Location: Jakarta
Distribution: Kubuntu 7.04
Posts: 35

Original Poster
Rep: Reputation: 15
Well, with the tsunami disaster I have been involved with the relief effort, but now have a moment to respond. I followed your advice, & the install went smoothly. I installed to a new username, then afterwards added a suer with the same name as my old user. Loged into old_user had some strange effects, but the files were available to copy to new_user. Still gotta digest details of your post, but thanks for the help! btw, RH wasn't what I expected--seems real slow on my mach. will give it a chance for awhile.
 
Old 01-03-2005, 02:42 AM   #10
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
I would simply do this:

cd to /home
tar up your home directory
Code:
tar -c username.tar /home/username/* | gzip
replace username with your username
burn that .tar.gz to a CD
install your other distro
add the user, with the same name, and make sure it creates the home directory
the, as root, cd to /home
delete that user's home directory,
and then (while still in /home)
Code:
tar -xzvf username.tar.gz
then, make sure that the user owns all the files
Code:
chown -R username /home/username/*

Last edited by scuzzman; 01-03-2005 at 02:43 AM.
 
Old 01-04-2005, 11:48 AM   #11
johnmart
Member
 
Registered: Jun 2004
Location: Jakarta
Distribution: Kubuntu 7.04
Posts: 35

Original Poster
Rep: Reputation: 15
Hi skuzzman, pretty straightforward approach. Actually, I already did the act, & just installed to a different username, added a new user with the same-old-name, then copied the files. But when I logged in to the old user, it behaved strangely. According to rick485 home contains alot of hidden files--I assume created by Mandrake--wold they interfere with the lod home/user becoming a new one on the new distro? It is a moot question, so maybe not worth delving into, but next time I will simply burn my files to cd. I don't know why I took such a roundabout--difficult route. Tx, to all!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
install new distro WITHOUT loseing data in /home and other partitions Lleb_KCir Linux - General 5 07-20-2005 10:47 AM
home network (win & lin) file/print server, distro? jollyjoice Linux - Networking 3 11-03-2004 01:51 PM
/home seperate partition from previous install, make it new /home in new install mipia Slackware 5 06-21-2004 11:57 PM
help needed how to write & save a script to install realplayer on redhat9.0 hasan Linux - Software 5 11-10-2003 03:31 PM
"Could not save properties. You do not have sufficient access to write to /home/rons rdaves@earthlink.net Linux - General 1 06-28-2001 10:21 PM


All times are GMT -5. The time now is 03:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration