Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 05-12-2008, 03:05 AM   #1
LQ Newbie
Registered: Apr 2006
Posts: 3

Rep: Reputation: 0
Reinstall RHEL4 without losing data

Hi all,

How to reinstall the RHEL 4 without losing the data.

Old 05-12-2008, 11:11 PM   #2
Registered: Mar 2008
Posts: 73

Rep: Reputation: 16
Any time your re-installing, it's possible to make a mistake and lose everything, therefore I recommend backing up all critical data to a USB drive or some other external device. Large external USB's are cheap and can be completely disconnected during the reinstallation.
If you don't have one, ask a friend to borrow theirs.

The main directories that you need to backup are /etc, /root, /home, and possibly
/var or at least parts of /var, and maybe /boot. There are several programs that you can use to backup the system. Since you said you are going to reinstall anyhow, I suggest
using tar, you could use a for loop like this:

mkdir /usb
mount -t vfat /dev/sda1 /usb # Mount the external drive (assuming FAT filesystem)
# Run this loop from / (the root directory)
for DIR in root etc home var boot
tar -czvf /usb/${DIR}.tgz ${DIR}
umount /usb # Unmount the external drive when done

Backing it all up
You may want to backup the entire drive using tar -czvf /usb/everything.tgz /
or look into the dump command. However, even if you back it all up,
I recommend at least having a these smaller tarfiles for easy access to important
files later.

To extract, use tar -xzvf root.tgz etc.
Note, do not restore the etc, boot, and var directories overtop the new install,
extract them into a separate directory, and only copy files as needed.

Partitioning drives
Note, I don't know how many partitions you separated your disk into
during your original install, but I highly recommend creating at
least two partitions during your reinstall. Create a root (/) partition,
and a home (/home) partition, then if you want to re-install or upgrade,
you can reformat / without losing any files in /home. Having
separate /var, /usr, /boot, and /tmp filesystems also have several benefits.
Old 05-13-2008, 12:06 AM   #3
LQ Newbie
Registered: Apr 2006
Posts: 3

Original Poster
Rep: Reputation: 0

Is It not possible to reinstall without taking backup. I think is there. Please guide me.

Old 05-13-2008, 06:54 PM   #4
Registered: Mar 2008
Posts: 73

Rep: Reputation: 16
When you start an install, it will look for an existing linux partition, it should then give you an option
to upgrade. If your using the exact same version, it should just re-install over it. Other posts might have more experience with this.


reinstall, rhel4

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
network bonding problem in RHEL4 x64 ( packets losing ) Jerais Red Hat 3 05-25-2007 06:55 PM
How can boot reinstall ubunto without losing all my database? sidneylab Linux - Newbie 1 03-26-2006 07:46 AM
Repartitionning without losing data mimithebrain Linux - General 6 10-22-2005 05:38 PM
reinstall windows without losing linux ereeno Linux - Software 30 09-04-2003 04:55 AM
keep losing data from /usr bdp Linux - General 4 07-06-2002 03:21 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:35 PM.

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