Skip to topic | Skip to bottom
Search:
Home

Chris and Janet's website

Home


Start of topic | Skip to actions
Linux tcp tuning: http://www-didc.lbl.gov/TCP-tuning/linux.html


Generate random numbers on linux:

dd if=/dev/urandom bs=1 count=128 | od -x


Solaris: psrinfo -v lists the processors on a box


Re-format external USB hard-drive

Motive: I wanted a backup solution that preserved file permissions when using rsync with the -a option.

My Western Digital usb drive had a vfat file system - which doesn't preserve file permissions.

This is what you'll need to do in order to convert to an ext3 file system:

When you plug the drive in check dmesg to find out which /dev device it's been mapped to. I found mine under /dev/sda1.

Then you'll need to partition the disk:

fdisk /dev/sda1

This will give you a command prompt interface. Type p to get a list of the current partitions.

I had 4 partitions, so I deleted them all using the d command.

Then create a your partition(s). I created 1 great big extended partition using the n command. It asks you a few questions about block sizes etc, I chose the defaults.

Then I typed w to write the partition data to the disk. Then I quit fdisk.

Then I created the filesystem:

mkfs.ext3 /dev/sda1

It asked me a few questions, I excepted all the defaults.

Then you're ready to mount the device:

mount /dev/sda1 /mnt/usbdrive

You'll have to create the folder /mnt/usbdrive yourself.

So that the disk gets mounted on reboot add the following line to /etc/fstab:

/dev/sda1 /mnt/usbdrive ext3 defaults 0 0

This also means you can simply type:

mount /dev/sda1

when mounting the disk from the command line.
to top


You are here: Home > WebLeftBar > TechStuff > UnixStuff

to top