Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Answers to Frequently Asked Questions Tips and Tutorials Octave --- My octuple boot laptop Post 302092869 by Perderabo on Thursday 12th of October 2006 05:35:32 PM
Old 10-12-2006
Failsafe Booting

The /mastergrub partition has the grub software and the kernels for each installed Linux distro. Grub stage 1 resides in the Master Boot Record (MBR) which is the first sector of the disk. More often than not, each OS install would rewrite the MBR to point to it's own copy of grub or other bootloader. Sometimes I would fiddle around the grub software in /mastergrub and break it. In addition to installing grub stage 1 in the MBR, stage 1 can be installed in the first sector of that partition. And then some other bootloader can chainloader into it. I wrote my own installation scripts. They are:

mbrinstall
This script simply installs grub stage 1 in the MBR.

localinstall
This script installs grub stage 1 in the local partition. (/mastergrub for now.) Then is uses dd to obtain a copy of the first sector of the local partition. This is put in a file in the /driveE filesystem. Recall that /diveE is a FAT32 filesystem used to pass files between linux and XP. Windows XP will obtain the sector and incorporate it into the XP bootup sequence. In XP my boot.ini file is something like:
Code:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Pro" /fastdetect /NoExecute=OptIn
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Pro (Safe Mode)" /fastdetect /NoExecute=OptIn /safeboot:minimal /sos /bootlog
C:\bootsector.mastergrub="MasterGrub Menu"
C:\CMDCONS\BOOTSECT.DAT="Microsoft Windows Recovery Console" /cmdcons

So now, if I can boot XP, I can use XP to transfer control to grub in /mastergrub. This is a big help since most OS install scripts install a boot loader with an option to boot Windows. So I can use that option, start to boot XP, but select the menu option to boot /mastergrub. Then I boot a distro, and run the mbrinstall script mentioned above.

floppyinstall
Booting from XP will not work if I have damaged the grub software in /mastergrub. I don't have room on a floppy for those kernels, but I have never broken my kernels. I easily have room on a floppy for grub, including the grub.conf file. This script creates such a floppy. Then I can boot the floppy and start the system that way.

cdinstall
What if I completely lose /mastergrub? cdinstall creates a CD which is a complete backup of /mastergrub. Additionally, it is a bootable CD which can boot any of the distros without using /mastergrub at all. This script needed a piece of Grub called stage2_eltorito which was not supplied with any version of Grub that I had. So I downloaded and compiled the source code from the Grub home page.

/backupgrub and /testgrub
Actually all of the above scripts have benn extended to support /backupgrub. This is simply another partition which is a copy of /mastergrub. Every now and then, I use rsync to copy the files over. Then I cd into /backupgrub and run the localinstall script. Whenever one of these scripts runs, it figures out what partition it is running in. The grub.conf file is adjusted to reflect the current partition (or in the case of cdinstall, adjusted to boot from cd). I also created a /testgrub partition so that I would stop running dangerous experiments in a critical partition.

supermbrbackup
A number of utilities exist to backup and restore the MBR. This includes the boot code and the partition table. The thing is though, that of my partitions are described in Extended Boot Records scattered all over my disk. I wanted a utility that would recreate all of my partitions (empty of course) on a brand new disk. And while I was at it, I had it scan the unused sectors after the MBR which is where GRUB stage 1.5 resides. So this backs up everything except the contents of partitions. The backup are written to a floppy along with a script to restore them. This script can be run after booting the System Rescue CD. My intent was that this would be the first step in a bare metal restore. But it turns out that I didn't need it.

Bare Metal Restore
This is what happen if I lose the entire hard disk. This is the ultimate in ensuring that I can boot. I used Acronis True Image to do a complete backup of my drive. It does not support Linux LVM nor FreeBSD and Solaris slices. But it can do a sector-by-sector backup of those partitions. After the backup finished, I replaced my hard drive and used my bootable Seatools disk to zero it out (9 hours with a 100 GB disk). Then I booted my Acronis boot disk and fed it the backup DVD's. It recreated my entire system.

I used a Seagate utility to write zeros to the entire disk before I started. That means that the Linux LVM and FreeBSD/Solaris partitions probably had a lot of zeroed sectors in the unused space. This helps the compression routine in the Acronis sector-by-sector backup do a good job.

I still need a file level backup for Linux/FreeBSD/Solaris. I will work on that.
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How-to boot server with no CDROM via serial connection to laptop

I have an x86 Sun server, with no CDROM drive and no OS currently loaded on it. I need to install CentOS on it... trying to figure out how to do that. I've heard there are ways to connect to the serial management port, and mount a laptop's CDROM drive as a drive the server will recognize to... (0 Replies)
Discussion started by: Mariognarly
0 Replies

2. Ubuntu

Connect 2 laptops with RJ45 cable (Ubuntu 10.10 laptop with Windows 7 laptop)

Hi to all, I have the problem that a laptops with windows XP cannot startup even in safe mode nor using last good known configuration. I have a Ubuntu 10.10 Live CD and booting from it I can read the Hard Drive. I need to do a backup the Hard Drive from XP laptop and I want to connect this... (5 Replies)
Discussion started by: cgkmal
5 Replies

3. UNIX and Linux Applications

Where Octave stores it's variables

Hej guys, I'm doing some simple matrix operations with octave and don't know where and how it stores it's variables. Is there any file somewhere that could be accessed? I was using MATLAB before and now Octave is new for me. Or maybe I should use some commands to save and load it. but... (0 Replies)
Discussion started by: Johanni
0 Replies

4. Shell Programming and Scripting

using Octave and bash command together

Hej all, I have an script which I run it with Octave command in Linux, I want to know how could I put bash commands like grep and sed and use them together with octave? My Octave script: Script.sh: m = load ("file", "-ascii") for i=1:10 g(i)= sin(m) end and then I use this... (2 Replies)
Discussion started by: Johanni
2 Replies

5. Red Hat

After installing redhat, my laptop boot straight to Windows 7

Hi all, Good day. I just installed RHEL6.3 into my laptop to learn RH. There is an existing Windows 7 in there. After installing the RHEL, the laptop will just boot to Windows 7. I tried to use this BCDedit to add Linux entry to the boot menu, BUT each time i pick the redhat selection,... (5 Replies)
Discussion started by: wingcross
5 Replies

6. Programming

How to install Octave?

This is probably something really simple, but I don't get it. I downloaded a copy of Octave and extracted it to octave-2.1.73-sol10-sparc-local. Now what do I do with it? I chmod'ed it to 777 and tried running it which just gave me an endless stream of errors. Here's the beginning of the file... (4 Replies)
Discussion started by: Michele31416
4 Replies

7. Ubuntu

Laptop to laptop transfer files

Dear all, I would like to transfer my old laptop documents/files etc to the new laptop without using any external hard disk. Please let me know if its possible via any way. Thank in advance, emily (3 Replies)
Discussion started by: emily
3 Replies
All times are GMT -4. The time now is 02:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy