[mythtv-users] Kernel Panic - SCSI & IDE

John Johnson johnatl at mac.com
Mon Jul 10 01:36:09 UTC 2006


On 09-Jul-2006, at 11:37, Jeff Wormsley wrote:

> John Johnson wrote:
>>> You should have room to do a quick backup of everything.
>>> Make a place for the backups, unmount the boot partition, and dump a
>>> compressed image of it to a backup file.
>>>
>>> mkdir -p /var/backups
>>> umount /boot
>>> dd if=/dev/sda1 | gzip -c >/var/backups/boot.image.gz
>>>
>>> Backup the root partition.
>>> tar cvjf /var/backups/root_after_os_install.tar.gz --exclude '/var/
>>> backups/*' /
>>>
> Somewhat off topic, but what do you do with this tar if you want to
> restore it, especially to a different disk than it originally came  
> from?
>
> The reason I ask:  I struggled with HD noise on my myth box, so I
> decided to start over using a 4GB laptop drive that runs very quietly.
> I now have this system up and running nearly perfectly on this drive,
> with optical SPDIF, lirc, lcdproc, gizmo for my powermate, perfect
> 1920x1080p xorg setup, and so on, using a smb mount to hold my
> video/audio storage on a separate 1.4TB file server.  It took a lot of
> work to get this going correctly.  However, because of the small  
> size of
> the drive, I am running into problems with IOBOUND errors, that  
> seem to
> be occurring because I have less than 20% free space on this tiny
> drive.  So, I am thinking I will have to go back to the 200GB drive I
> was using before to hold recordings, then transcode/archive them to  
> the
> file server if there are any I want to keep.

If you're using ext2 or ext3 on your drive, I would use dump and  
restore.
You'll need the statically linked versions of them provided by the  
dump package, which you may have, or you can find with:
apt-cache search dump | less
or
yum search dump | less

To create the dump, you can do this:

dump -0 -u -z9 -f my_backup.dump.z /

Which means:
dump	an ext2/ext3 file system
-0	dump everything (See 'man dump' for an explanation. Bring aspirin.)
-u	update the /etc/dumpdates file noting what we backed up, and when
-z9	-z means compress the output, 9 means compress it really hard.
-f file	Send the output to file
/	The filesystem to dump. Do this for each of your mounted filesystems,
	for instance, /boot, /, /home, etc.
You can burn these files to a CD or DVD, put them on a network share,  
etc.

I always get the boot block from the drive, just in case:
dd if=/dev/hda of=my_boot_block_backup bs=512 count=1
Which means dd (disk dump?) from the /dev/hda drive to a file called  
my_boot_block_backup, using a block size of 512 bytes, and copy 1 block.

I also like to save info about my partitions like so:
fdisk -l >fdisk_list
mount >mounted_partitions
cp /etc/fstab fstab_backup
cp /boot/grub/grub.conf grub_conf_backup

(If /boot is on a partition of it's own, be sure it's mounted (use:  
mount /boot) before doing 'cp /boot/grub...' command, or you'll get  
the wrong file, or no file.)

and I print them out to have around when restoring.

To restore on your new drive, go download Tom's RootBoot (tomsrtbt).
from one of the mirrors listed at http://www.toms.net/rb/
also pick up the FAQ, etc. when you're there. Make a boot floppy, CD,  
thumb drive, etc. You'll also want your dump and restore commands  
available (on another floppy, etc.).

Install your new drive, remove the old for safe keeping.
Boot from tomsrtbt.
Partition your disk with the same number of partitions (or more) as  
the old drive. You can use fdisk from tomsrtbt.
Format and restore the partitions as follows:
mke2fs -j /dev/hda1
mount /dev/hda1 /mnt
cd /mnt
restore rf yourfile
cd /
umount /mnt

Repeat for each partition you backed up. For your swap partition(s)  
if you have any, use the mkswap command.
mkswap /dev/hda2

Try booting from the drive. If you can't boot, run the grub-install  
command if you use grub, or the lilo command if you use lilo. If that  
doesn't work, try restoring the boot block you backed up:
dd if=my_boot_block_backup of=/dev/hda bs=512 count=1

That should get you back on the air using your new drive.

Another option: if you have room, leave the small drive in, and mount  
the larger drive as video storage.

If the 200G drive is noisy when seeking, not just from spinning, you  
might be able to use hdparm to quieten it down. Something along the  
lines of:
hdparm -M 128 /dev/hda
That is listed as an experimental command, though I've never had a  
problem with it. If that works, you can add it to your /etc/rc.local  
file, or you can tinker with /etc/sysconfig/harddisks (I would use  
the /etc/rc.local route myself).

Let me know how it goes.

Regards,
   JJ



More information about the mythtv-users mailing list