Grub - how to boot a copy of Linux (full system backup)


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Grub - how to boot a copy of Linux (full system backup)
# 8  
Old 02-07-2013
Debian

Quote:
Originally Posted by coolatt
Do I need to absolutely reinstall Grub? (Its a bit scary for me even though its not a PROD Machine Smilie )

Also note that the "SystemBackup02" is just another directory on the same disk /dev/sda.
Someone please help me..I take backup very seriously. Smilie
# 9  
Old 02-11-2013
concept clarification

just to calm you down:

the command
Code:
grub-install

is part of the 'grub' package.

- you can check it out with
Code:
man grub-install

- and for the sake of correctness, "reinstall grub" refers to the 'grub package' as a whole, while "running grub-install" is just making good use of the same package.

please note that "running grub-install" is indeed a risky operation - specially if you do not plan ahead - and know - what you are doing.

HTH

good luck, and success!

alexandre botao
("comets never dodge")
# 10  
Old 02-12-2013
Quote:
Originally Posted by coolatt
Someone please help me..I take backup very seriously. Smilie

When you edit grub.conf to add another boot option, you will have to re-build the stage-2 GRUB loader; which is why is a necessary step.

The GRUB stage-1 is just a 512 bytes system boot loader which is written at MBR (which is located in most PC based machine at track-0, sector-1 of their boot disk) and by the common disk architecture it can only be limited to 512 bytes (Till you actually get the newer 4KB sector disks).

GRUB stage-1 is what which actually let your machine to boot after POST (Power On Self Test done by BIOS) and subsequently loads the stage-2 which could be of different sizes (based on the total number of boot-menu displayed) and is actually responsible to rendered the boot menu options; Which you would need to create to get your new boot option menu displayed.

This needs to be built when you run 'grub-install'. This is specially true if you have GRUB version below GRUB-2 (under GRUB-2, there is a intermediate stage of stage1.5, loaded by stage-1, instead of stage-2 directly. Stahe-1.5 is basically enabler of basic file system reading capability to GRUB). Hence under GRUB-2 one can just modify the boot configuration and it reads the configuration to be rendered and displayed under stage -2 for you to boot your machine.

But there are issues:
1) If the disk file system is a custom one (i.e. not of common FS like UFS, ext2, ext3..4, reiserFS, etc.. or anything drives out of lineage) then the GRUB can't directly access the disk to access the boot.conf; hence won't give you the menu.

2) Incase, stage-1.5 is not present the still stage-2 gets loaded by stage-1 and in this case too the boot menu would not be rendered out of the latest configuration you saved into your grub.conf.

In both these cases (at least) you will have to perform the grub-install to create the grub images (both Stage-1 and Stage-2). It creates Stage-2 first and then the Stage-1 and inserts the starting sector number of the location of Stage-2 inside Stage-1 image. Hence Stage-1 can access and transfer control while boot strapping.


Hence in majority of the cases one should do the 'grub-install' except a few when your boot disk is formatted with most common Linux FS.

Hope that I answered your query.
This User Gave Thanks to Praveen_218 For This Post:
# 11  
Old 02-12-2013
Quote:
Originally Posted by Praveen_218
When you edit grub.conf to add another boot option, you will have to re-build the stage-2 GRUB loader; which is why is a necessary step.

The GRUB stage-1 is just a 512 bytes system boot loader which is written at MBR (which is located in most PC based machine at track-0, sector-1 of their boot disk) and by the common disk architecture it can only be limited to 512 bytes (Till you actually get the newer 4KB sector disks).

GRUB stage-1 is what which actually let your machine to boot after POST (Power On Self Test done by BIOS) and subsequently loads the stage-2 which could be of different sizes (based on the total number of boot-menu displayed) and is actually responsible to rendered the boot menu options; Which you would need to create to get your new boot option menu displayed.

This needs to be built when you run 'grub-install'. This is specially true if you have GRUB version below GRUB-2 (under GRUB-2, there is a intermediate stage of stage1.5, loaded by stage-1, instead of stage-2 directly. Stahe-1.5 is basically enabler of basic file system reading capability to GRUB). Hence under GRUB-2 one can just modify the boot configuration and it reads the configuration to be rendered and displayed under stage -2 for you to boot your machine.

But there are issues:
1) If the disk file system is a custom one (i.e. not of common FS like UFS, ext2, ext3..4, reiserFS, etc.. or anything drives out of lineage) then the GRUB can't directly access the disk to access the boot.conf; hence won't give you the menu.

2) Incase, stage-1.5 is not present the still stage-2 gets loaded by stage-1 and in this case too the boot menu would not be rendered out of the latest configuration you saved into your grub.conf.

In both these cases (at least) you will have to perform the grub-install to create the grub images (both Stage-1 and Stage-2). It creates Stage-2 first and then the Stage-1 and inserts the starting sector number of the location of Stage-2 inside Stage-1 image. Hence Stage-1 can access and transfer control while boot strapping.


Hence in majority of the cases one should do the 'grub-install' except a few when your boot disk is formatted with most common Linux FS.

Hope that I answered your query.
Ok..Great Theory on the Grub Thing.
please guide me on the technical part...thanks
# 12  
Old 02-12-2013
Quote:
Originally Posted by coolatt
Ok..Great Theory on the Grub Thing.
please guide me on the technical part...thanks
If you really got this Theory you would know what to do.
Look at my previous post too & deduce inference and get your job done.

That's one way it is done. At least I do.

---------- Post updated at 09:01 PM ---------- Previous update was at 08:51 PM ----------

Quote:
Originally Posted by coolatt
Hi All,


On the restore server (standby machine), everytime i have to erase the disk & extract the tar backup.

I want to extract the tar on the running restore server on a directory for e.g /systembackup-01, /systembackup-02, etc.. & be able to boot one of the backup using grub.

Thanks to help me on this.

coolAtt
If you are taking tar archive of the '/' and on your backup machine; the kernel & H/w configuration is exactly same; then you may also try running 'chroot <systembackup_dir>' to mount the same as fake root. This is way safer (from your perspective) as nothing will change actually on your backup server system.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Help - Chosing backup way (full system + zones)

Hello i am new on Solaris, and i need to migrate my old AIX 5.3 to Solaris 11.2 Now i have all apps working fine but i have the backup cause i was reading and i have not idea about what method must i choose. Btw on AIX i had a mksysb backup to restore all system and obviously another backups to... (4 Replies)
Discussion started by: thorin666
4 Replies

2. UNIX for Advanced & Expert Users

how to make a full system backup excluding data and restoring it to a new system

Hi, In order to have a sand box machine that I could use to test some system changes before going to production state, I'd like to duplicate a working system to a virtual one. Ideally, I'd like to manage to do it this way : - Make a full system backup excluding the user file system (this... (7 Replies)
Discussion started by: pagaille
7 Replies

3. HP-UX

HP-UX Full System Backup with fbackup

Hello, I'm still new in HP-UX backup and I want to do a FULL BACKUP of HP-UX server to TAPE device. After reading on several forums and posts, i have list down several steps on how to do a full backup on HP-UX with fbackup. I would like the gurus here to comment/advise on the steps below 1)... (4 Replies)
Discussion started by: miskin
4 Replies

4. UNIX for Dummies Questions & Answers

Full System Backup Sco 5.0.5

I would like to know if I can do a full system back up on my Unix Sco openserver 5.0.5 Machine. If so, What is the syntax to do this or where can I find this information at? Also, is it possible to make this tape bootable so that I can easily do a full system restore? Any information on... (2 Replies)
Discussion started by: nellenodrog
2 Replies

5. Solaris

full system backup

I have unix server with OS 5.8 ,,, I tried ufsdump 0ua -f /dev/rmt/0 / to perform full system backup on tape but I failed could any one give a procedure for full system backup on solaris machine using tapes??? (1 Reply)
Discussion started by: mm00123
1 Replies

6. UNIX for Dummies Questions & Answers

System full backup to tape

hi, Recently, I had receive one system. it's run on the unix tru64 server. I looking some log files when i know don't work few months age system backup to tape. Below error: INFO:Tape backups to tape tape0 starting for backup list: slot2:/disk4 Backup Command Variable... (0 Replies)
Discussion started by: Tlg13team
0 Replies

7. Linux

full system backup script

Please help. I am new to linux. I wrote a script to run the backup on lunix machine but the job gave me an error. I am using Linux 2.6.14.3. Below is the sample of my script can anyone tell me where went wrong? Thanks in advance. #!/bin/sh dat=$(date +%d%b%y)... (5 Replies)
Discussion started by: clement
5 Replies

8. UNIX for Dummies Questions & Answers

Full System Backup / Cloning HPUX

I am new to UNIX and need help in cloning a HPUX 10.2 Ace 5, can anybody please guide me in making a full system backup. Real Chess (0 Replies)
Discussion started by: real-chess
0 Replies

9. Red Hat

linux will not boot, boot to grub prompt

my redhat 9 will not boot. We had a power failure and when the power came back, my redhat linux will not boot. The machine come up to grub prompt. I tried the following from grub prompt root (hd0, then press tab key partition num:0 filesystem type unknown, partition type 0x83... (7 Replies)
Discussion started by: hassan2
7 Replies

10. UNIX for Dummies Questions & Answers

Can't get GRUB to boot Linux!!!

I have installed Linux 7.2 on a IBM xseries 235 server with 5 scsi hard drives and ServerRaid-5i Ultra320 scsi controller. I started my installation by configuring the raid controller. I created 2 arrays, raid 1 and raid5. I then proceeded to install Linux and load the drivers. After the... (2 Replies)
Discussion started by: cstovall
2 Replies
Login or Register to Ask a Question