LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 06-17-2003, 05:34 PM   #1
MrJoshua
Member
 
Registered: Apr 2002
Location: Houston Texas
Distribution: Debian / Gentoo / RHEL
Posts: 209

Rep: Reputation: 31
RH7.3 Backup and Restore


I seem to be having HD problems with on my Dual MP server at work, it is running RH 7.3 and has MP 1800+s in it, on a Tyan Tiger 2460. Grub takes forever to load, and about half of the time it fails to mount the HD. The drive clicks alot as well. So of course the HD is bad.

My question is that I need to tar and gzip everything in the file system, and install Grub on a the new HD, and put a mirror image of the filesystem of the server on the new HD. I also need Grub to call of the old data that will be put on the new HD. I need to do this with out using dd, since there is no way to get an exact matching HD now. Does anyone have any tips or know of any docs I can read on this? Thanks for your help.
 
Old 06-18-2003, 06:20 AM   #2
plepps
LQ Newbie
 
Registered: Jun 2003
Posts: 4

Rep: Reputation: 0
hi,

you dont need dd, you can make it with tar. its easy and the
destination disk must not have the same size!
all links, devicese etc. will be move correctly to the new location.

if your old hd eg. hda and the new one hdc it works like follow:

boot your system and then
make the partions on the new one as you like and make the
filesystems on it. (in my scenario i would like use only one big slice
for / so its easier to describe)

mount -t ext2 /dev/hdc1 /mnt
cd /
tar cflp - . | ( cd /mnt ; tar xfvlp - )

e.g. if you have the /usr file system on the source at a diferent
partition and at the new one too - so you have to do the follow:
(e.g. hda6 = /usr -> hdc8 = /usr)

mount -t ext2 /dev/hdc8 /mnt/usr
cd /
tar cflp - /usr/ | ( cd /mnt/usr ; tar xfvlp - )

after all stepps please check the fstab on the new hd so it reflect the new slices and configure your bootloader.


regards
thomas
 
Old 06-18-2003, 10:15 AM   #3
MrJoshua
Member
 
Registered: Apr 2002
Location: Houston Texas
Distribution: Debian / Gentoo / RHEL
Posts: 209

Original Poster
Rep: Reputation: 31
Thanks for the information it helps. Do I need to install the Boot loader to the MBR? I am a little confsed on what to do with the boot loader. I understand the FSTAB part.
 
Old 06-18-2003, 12:01 PM   #4
plepps
LQ Newbie
 
Registered: Jun 2003
Posts: 4

Rep: Reputation: 0
I cant help you with the grub loader - I only know lilo

regards
thomas
 
Old 06-18-2003, 12:54 PM   #5
MrJoshua
Member
 
Registered: Apr 2002
Location: Houston Texas
Distribution: Debian / Gentoo / RHEL
Posts: 209

Original Poster
Rep: Reputation: 31
Also I wondered what you recommended for partitioning in RH7.3 I have always used Disk Druid in initial setups, but I did not know if you could use it from the OS or rescue mode without being in the installer.
 
Old 06-18-2003, 01:07 PM   #6
plepps
LQ Newbie
 
Registered: Jun 2003
Posts: 4

Rep: Reputation: 0
hmmm - I cant give you a recommendation for partitioning your system - I prefer seperate partitions for / /tmp /usr /var /home and in some cases /opt.

disk druid is only a gui for fdisk, so all you do with disk druid, can you do too with fdisk (only for the software raid configuration you need the raid tools).

put both disks in your system, boot it with the rescue disk, use
fdisk -l /dev/hda (if hda is your old disk) to see the partions on the old HD and create
with fdisk /dev/hdc (if hdc is the new one) the new partitions
 
Old 06-18-2003, 01:28 PM   #7
MrJoshua
Member
 
Registered: Apr 2002
Location: Houston Texas
Distribution: Debian / Gentoo / RHEL
Posts: 209

Original Poster
Rep: Reputation: 31
thanks that is what I thought I should do. Also I just did a test of this and it works great. I really appreciate all of your help. Thank you

-Joshua
 
Old 06-18-2003, 02:13 PM   #8
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,155

Rep: Reputation: 56
After you create the partitions you want, you need to format them before you can untar the filesystem to them

mkfs -t type /dev/hd??
type being the fs type to create
/dev/hd?? being the name of the partition

if it's ext3 you can do it this way
mke2fs /dev/hd??
tune2fs -j /dev/hd??

you will be limited to whatever the running kernel supports and also what types mkfs supports that you have installed.
 
Old 06-18-2003, 02:18 PM   #9
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,155

Rep: Reputation: 56
Don't forget to update the bootloader config file to point to the new partitions(s)

And also the fstab file in the new partitions /etc folder
 
Old 06-18-2003, 02:46 PM   #10
MrJoshua
Member
 
Registered: Apr 2002
Location: Houston Texas
Distribution: Debian / Gentoo / RHEL
Posts: 209

Original Poster
Rep: Reputation: 31
thnx, I was just wondering does the mke2fs /dev/hd?? tune2fs -j /dev/hd?? make the ext3 partitions? I thought mke2fs was for ext2? Also mkeswap is what I need to use to initialize the swap correct?
 
Old 06-18-2003, 02:59 PM   #11
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,155

Rep: Reputation: 56
the filesystem is created where you specify

/dev/hd??

example, to create an ext3 filesystem on the first partition on the first hard drive

mke2fs /dev/hda1
tune2fs -j /dev/hda1

ext3 is the same filesystem as ext2 with a journal added. that's why you need to use tune2fs, to create the journal.

you can make the swap partition after the new system is up and running or before.

mkswap sets up the partition that you have created as type swap. the fstab file will be where the system is told to mount it at boot. Be sure to give the right name to mkswap

mkswap /dev/hd??

If you create the swap partition after booting the new system then use swapon /dev/hd?? to mount the swap partition.

Last edited by DavidPhillips; 06-18-2003 at 03:03 PM.
 
Old 06-18-2003, 03:12 PM   #12
MrJoshua
Member
 
Registered: Apr 2002
Location: Houston Texas
Distribution: Debian / Gentoo / RHEL
Posts: 209

Original Poster
Rep: Reputation: 31
Thanks guys this is exatly the information I was looking for. I really appreciate it.
 
Old 06-18-2003, 03:21 PM   #13
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,155

Rep: Reputation: 56
I might add that when you create a partition in fdisk you will need to set the type of partition with t

so in reference to creating a swap partition enter t
then the number of the partition 1, 2, 3, or 4
then the type
82

for the linux partition the default is what you want to use so it's ok
 
Old 06-18-2003, 03:58 PM   #14
MrJoshua
Member
 
Registered: Apr 2002
Location: Houston Texas
Distribution: Debian / Gentoo / RHEL
Posts: 209

Original Poster
Rep: Reputation: 31
Thanks, I was also just making sure, you do not need to backup /dev, and /proc those are generated. I assume that you do need to creat e their directroy with correct permissions.
 
Old 06-18-2003, 05:28 PM   #15
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,155

Rep: Reputation: 56
that's sorrect

I use this script to do an auto backup..

#!/bin/sh
mount /mnt/backup
cd /
NAME=`date +%m-%d-%y`
tar -cv . --exclude ./mnt --exclude ./proc --exclude ./var/spool/squid --exclude ./tmp --exclude ./var/tmp | gzip -9 > /mnt/backup/www_backup_$NAME.tar.gz
umount /mnt/backup


by using --exclude you can easily backup everything except /dev and /proc


be sure you do it like this

--exclude ./folder

without the ./ (dot slash) anything named dev or proc will be skipped
 
  


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
Backup and restore Kmail RaiReg Linux - Newbie 1 09-09-2005 05:41 PM
backup / restore 5pints Linux - Software 2 01-11-2005 10:08 AM
Backup and restore? tradewind Red Hat 2 07-02-2004 11:18 PM
W2K backup and restore itsjustme General 0 06-02-2004 01:46 AM
RH 7.3 Backup and Restore MrJoshua Linux - General 1 06-18-2003 12:39 PM


All times are GMT -5. The time now is 09:18 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration