Grub is very smart but not as smart as you want  believe.
It has 38 commands (see below)

You can easily achieve you goal *without reinstalling, swapping out disks or entering rescue mode to fix things.

"DD"  is nearly always available!

However no matter how badly a system gets hosed, there is nearly always /sbin that stays intact. Also /etc/fstab & a few other files of paramount importance are often intact to allow a minimal system to be run.
.....  then you have "dd"   to copy partions here & there.

The 3 Run levels of : emergency , 1 , S often are available when you can't boot the system to higher run levels.
If ALL the above fails .....
appending            " init=/bin/bash "
to the kernel grub line will often work. (albeit in read only) you can fix that by "/sbin/mount -o remount,rw /"
note the full path is probably required.

Then DD will be available  " /sbin/dd"

If you have an exact image of a partiton elswhere just clobber the partion you have booted to.

Of course you must be certain of what partition you are on. ( having an erronous entry in fstab may fool you at this point... in which case "/sbin/df" will tell you lies.

The gotcha points are that /boot/grub/grub.conf entries must coincide with /etc/fstab.

Three variations work with these files
1  "device" names   as  a naming convention
2  "label"  names   as  a naming convention
3  "UUID"  strings   as  a naming convention
... again .... grub.conf  &    fstab must coincide

Hope this helps

Roger

Grub commands ..........  no dd  or cp etc

    1  blocklist FILE
    2  boot
    3  cat FILE
    4  chainloader [--force] FILE
    5  clear
    6  color NORMAL [HIGHLIGHT]
    7  configfile FILE
    8  device DRIVE DEVICE
    9  displayapm
   10  displaymem
   11  find FILENAME
   12  geometry DRIVE [CYLINDER HEAD SECTOR [
   13  halt [--no-apm]
   14  help [--all] [PATTERN ...]
   15  hide PARTITION
   16  initrd FILE [ARG ...]
   17  kernel [--no-mem-option] [--type=TYPE]
   18  makeactive
   19  map TO_DRIVE FROM_DRIVE
   20  md5crypt
   21  module FILE [ARG ...]
   22  modulenounzip FILE [ARG ...]
   23  pager [FLAG]
   24  partnew PART TYPE START LEN
   25  parttype PART TYPE
   26  quit
   27  reboot
   28  root [DEVICE [HDBIAS]]
   29  rootnoverify [DEVICE [HDBIAS]]
   30  serial [--unit=UNIT] [--port=PORT] [--
   31  setkey [TO_KEY FROM_KEY]
   32  setup [--prefix=DIR] [--stage2=STAGE2_
   33  terminal [--dumb] [--no-echo] [--no-ed
   34  terminfo [--name=NAME --cursor-address
   35  testvbe MODE
   36  unhide PARTITION
   37  uppermem KBYTES
38 vbeprobe [MODE]
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to