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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
|
06-17-2003, 04:34 PM
|
#1
|
Member
Registered: Apr 2002
Location: Houston Texas
Distribution: Debian / Gentoo / RHEL
Posts: 209
Rep:
|
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.
|
|
|
06-18-2003, 05:20 AM
|
#2
|
LQ Newbie
Registered: Jun 2003
Posts: 4
Rep:
|
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
|
|
|
06-18-2003, 09:15 AM
|
#3
|
Member
Registered: Apr 2002
Location: Houston Texas
Distribution: Debian / Gentoo / RHEL
Posts: 209
Original Poster
Rep:
|
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.
|
|
|
06-18-2003, 11:01 AM
|
#4
|
LQ Newbie
Registered: Jun 2003
Posts: 4
Rep:
|
I cant help you with the grub loader - I only know lilo
regards
thomas
|
|
|
06-18-2003, 11:54 AM
|
#5
|
Member
Registered: Apr 2002
Location: Houston Texas
Distribution: Debian / Gentoo / RHEL
Posts: 209
Original Poster
Rep:
|
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.
|
|
|
06-18-2003, 12:07 PM
|
#6
|
LQ Newbie
Registered: Jun 2003
Posts: 4
Rep:
|
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
|
|
|
06-18-2003, 12:28 PM
|
#7
|
Member
Registered: Apr 2002
Location: Houston Texas
Distribution: Debian / Gentoo / RHEL
Posts: 209
Original Poster
Rep:
|
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
|
|
|
06-18-2003, 01:13 PM
|
#8
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
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.
|
|
|
06-18-2003, 01:18 PM
|
#9
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
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
|
|
|
06-18-2003, 01:46 PM
|
#10
|
Member
Registered: Apr 2002
Location: Houston Texas
Distribution: Debian / Gentoo / RHEL
Posts: 209
Original Poster
Rep:
|
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?
|
|
|
06-18-2003, 01:59 PM
|
#11
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
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 02:03 PM.
|
|
|
06-18-2003, 02:12 PM
|
#12
|
Member
Registered: Apr 2002
Location: Houston Texas
Distribution: Debian / Gentoo / RHEL
Posts: 209
Original Poster
Rep:
|
Thanks guys this is exatly the information I was looking for. I really appreciate it.
|
|
|
06-18-2003, 02:21 PM
|
#13
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
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
|
|
|
06-18-2003, 02:58 PM
|
#14
|
Member
Registered: Apr 2002
Location: Houston Texas
Distribution: Debian / Gentoo / RHEL
Posts: 209
Original Poster
Rep:
|
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.
|
|
|
06-18-2003, 04:28 PM
|
#15
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 07:42 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|