bash

Updating Debian with fresh install on new drive

The following are the steps I take update Debian by making a fresh install on a clean drive.

Create a drive. There's plenty around to explain this step if you're not sure.

Format and mount the drive.

mkfs.ext4 /dev/sdb1 #enter your drive here
mount /dev/sdb1 /mnt

Install deboostrap and bootstrap the system using your arch and preferred distrobution. Mount proc and dev.

Update your dynamic IP with Afraid.org

Say you run a server of some kind at home and you don't have a static IP (who wants to pay the extra cash?), and you need the IP to update after your router restarts. It's simple with afraid.org and a bash script run by the cron system. This is the bash script:

Backup images of root and home filesystems

This is a nice way to make a backup of your root and home filesystems - at least this is how I get it done. Before you read on, I'll say that the home files are on a different mounted drive than the root files. These are also LVM2 drives. First I check the drive that will get the final partimage files. Then I mount the spare drive to be used by partimage. This allows me to never unmount the root and home filesystems. Then I unmount the spare drive and check it. Next I make the partimage copy or delete the tmp file if it fails. Last I delete images older than 25 days and unmount.

Subscribe to bash