[PLUG] need help with backups/restores and grub

Word Wizard Word.Wizard at comcast.net
Fri Apr 17 01:26:43 UTC 2009


Being a newbie (who sometimes lives in terror of what Linux can do if I
make mistake) I was fearful if possibly compressing a DD-ed partition
image might somehow corrupt something that would blow up all the
progress I've made. I realize that acquiring proficiency in Linux will
require accepting some serious screwups in the process but sometimes
going through the  reinstall process from the Intrepid distro DVD can
get tedious. Anyway, with hard disk storage being as cheap as it is
these days, the speed of a straight DD-ed image is more attractive than
a more time-consuming space-saving compressed version.

I'm trying to perfect a flawless backup model so I can play around,
break stuff, learn from my mistakes and eventually become proficient in
Linux administration. It helps to set up a reliable model of restoring
what worked well before I broke it. I suppose I could sign up for
classes in Linux administration somewhere but I seem to learn better
with the hands-on experimenting. Plus there is the  pride of mastering a
skill (mostly) through my own efforts. That's what moved me towards
working with PCs as more than an application user and thence to Linux. I
can't stand  the idea that someone out there can do something so easily
that I can't get the hang of. So much so that I keep banging away until
I can develop an equivalent proficiency. 

Thanks again   

Word Wizard 



On Thu, 2009-04-16 at 17:58 -0700, Dwight Hubbard wrote:

> I sometimes do a quick image backup over the network after booting
> from a livecd.  Compressing it on the host running dd keeps the
> network traffic down.
> 
> dd if=/dev/hda | bzip2 -c | ssh foosystem "/bin/cat
> > /backup/diskimg.bz2"
> 
> 
> On Thu, Apr 16, 2009 at 12:15 PM, Word Wizard
> <Word.Wizard at comcast.net> wrote:
> 
>         Another path to the goal 
>         
>         I did some more research about the  'dd' command (yes I am a
>         newbie) and that tool doesn't have tar's weakness in this
>         area. Copying the entire partition takes up ten times more
>         space than just tar-ing the individuals files but it is faster
>         than my preferred bzip2 compression format.  Once I starting
>         studying disk partitions I realized that it was better to
>         install the / file system on one partition and  /home on a
>         separate partition. That way I could dd my / partition and tar
>         my /home. The default Ubuntu installation model places  /
>         and /home on the same partition so it took me some time and
>         research to realize that manually designating separate
>         partitions for different parts of the file system was more
>         useful. 
>         
>         Thanks again for the help & information. Linux is becoming
>         more fun and less a pain as I learn more.  
>         
>         
>         Word Wizard 
>         
>         
>         
>         On Wed, 2009-04-15 at 19:59 -0700, Dwight Hubbard wrote:
>         
>         > Grub stores the actual physical locations of the datablocks
>         > of it's stage 1.5 or stage 2 files in the bootblock.  If you
>         > restore from a tar archive the location of the blocks for
>         > the grub stage files will almost certainly be different and
>         > as a result grub will generate an error 15 because it can't
>         > find them.  
>         > 
>         > After restoring from a tar archive you need to chroot into
>         > the newly restored filesystem and run a grub-install to
>         > cause the restored system to write the grub stage file
>         > locations to the boot block.
>         > 
>         > Or you can restore grub from the grub command.  If my memory
>         > serves the commands would look something like this (assuming
>         > your /boot filesystem (hd0,1) and you want the boot block on
>         > the first hard disk:
>         > root (hd0,1)
>         > setup (hd0)
>         > 
>         > On Thu, Apr 9, 2009 at 6:13 PM, Word Wizard
>         > <Word.Wizard at comcast.net> wrote:
>         > 
>         >         
>         >         One of the reasons I adopted Linux (Ubuntu Intrepid)
>         >         was that, unlike
>         >         Windows,  it SUPPOSEDLY allowed one to fully back up
>         >         the entire system,
>         >         system files and all, and restore them. So if you
>         >         installed files or
>         >         configured your system and made mistakes, you revert
>         >         to a previous
>         >         system. That's the theory. The reality is  a bitter
>         >         disappointment.
>         >         
>         >         I sudo su, change to /  directory and use the
>         >         following  command and
>         >         generate a valid tar backup:
>         >         
>         >         tar
>         >         cvpjf /home/username/BackUp/Archives/total_backup.tar.bz2
>         >         --exclude="/home//username/HD_1"
>         >         --exclude="/home//username/HD_2"
>         >         --exclude="/home//username/.thumbnails"
>         >         --exclude="/home//username/.mozilla/default/Cache"
>         >         --exclude="/proc"
>         >         --exclude="/lost+found" --exclude="/media"
>         >         --exclude="/mnt"
>         >         --exclude="/sys" /
>         >         
>         >         To restore,  I sudo su, change to the / directory
>         >         and use the following
>         >          command:
>         >         
>         >         tar
>         >         xvpjf /home/username/BackUp/Archives/total_backup.tar.bz2  -C /
>         >         
>         >         First problem. Upon reboot I get an "error 15" Can't
>         >         find the grub
>         >         files. They are there but It seems the problem may
>         >         be with  using UUIDs
>         >         instead of (hd0) notation. The UUIDs change. What
>         >         no-life propeller head
>         >         chose to use UUIDs anyway?
>         >         
>         >         It gets worse. I tried  booting from the distro DVD
>         >         (Intrepid)  and
>         >         using grub to 'find /boot/grub/stage1'.
>         >         
>         >         grub finds it (hd0,5). That's the correct location.
>         >         I use the sudo su,
>         >         then the root (hd0,5) command. No error messages. I
>         >         use the  setup (hd0)
>         >         command and the output says it found the
>         >          /boot/grub/stage1 file and is
>         >         writing (hd0)/boot/grub/menu/.lst.
>         >         
>         >         BUT... It does not write (hd0)/boot/grub/menu/.lst.
>         >         Anywhere. I check
>         >         the root drive and the old /boot/grub/menu/.lst is
>         >         still there. Even if
>         >         I rename it, no new menu.lst appears .
>         >         
>         >         
>         >         What am I doing wrong? Or is Linux still not ready
>         >         for prime time and
>         >         only for hackers?
>         >         
>         >         
>         >         
>         >         
>         >         
>         >         _______________________________________________
>         >         PLUG mailing list
>         >         PLUG at lists.pdxlinux.org
>         >         http://lists.pdxlinux.org/mailman/listinfo/plug 
>         > 
>         > 
>         > 
>         > 
>         > -- 
>         > Dwight Hubbard
>         > Owner Effective Automation Solutions
>         > Website: http://effectiveautomationsolutions.com
>         > Blog: http://computing.dwighthubbard.info
>         > Email: dwight at dwighthubbard.com
>         > Phone: (503) 616-4493
>         > Redhat Certified Engineer - RHCE #804007137224095
>         > VMware Certified Professional - VCP #18529
> 
> 
> 
> 
> -- 
> Dwight Hubbard
> Owner Effective Automation Solutions
> Website: http://effectiveautomationsolutions.com
> Blog: http://computing.dwighthubbard.info
> Email: dwight at dwighthubbard.com
> Phone: (503) 616-4493
> Redhat Certified Engineer - RHCE #804007137224095
> VMware Certified Professional - VCP #18529



More information about the PLUG mailing list