jeltsch's blog

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.

Connecting the external hard drive to my computer (Maxtor One Touch 200GB, FireWire & USB 2.0/1.1)

The hard drive was connected to Redhat9 Linux via firewire and the hard drive had a reiserfs filesystem. It was supposed to be used for backups, but suddenly stopped working (it was not anymore recognized during system startup). Probably that had something to do with the external USB zip drive. Both are apparently visible to the system as SCSI devices and the zip drive might have (via automount) occupied the sda number that was manually added to /etc/fstab to enable the Maxtor hard drive. To check whether everything is OK with the drive itself, I connected it to my work computer.

Pages