jeltsch's blog

(Re)installing GRUB bootloader

We had the following problem on the computer:
2 hard drives (hda and hdb).
hda contains the MBR (master boot record) and a Windows 2000 install on the first partition. hdb contains Linux (and its first partition is a boot partition that contains a GRUB installation as done by the RedHat 9 installer).

Mounting disk image files and encrypted filesystems/partitions

To dump a disk (or a partition) into a file, you use the following command:

dd if=/dev/hda3 of=file.bin

This command writes the complete data on the hda3 partition into the file file.bin.
To mount the filesystem that is in the file, you need to create a loopback device:

losetup /dev/loop0 file.bin

Now you can mount the filesystem as usual:

mount -r -t filesystemtype /dev/loop0 /mnt/mountpoint

Apparently, one can combine the last two commands into one:

Changing environment variables (env, csh, bash)

I just install BackupPC. The perl install script complains that my environment variable LANG is set to en_US.UTF-8 and that it should be en_US. This setting is specificed in RedHat 9 Linux in the file /etc/sysconfig/i18n. To check what is the current value of the LANG variable type echo $LANG. To change or set the variable to en_US type LANG=en_US To show all environment variables, just enter

env

at the command line.

Pages