Installing a New Hard Drive on Ubuntu

Installing a new hard drive isn't a particularly arduous task, but there are a few commands I usually forget. Here are the steps I take after hooking up a new drive:
  • Run fdisk -l and find the new drive's device (we'll call it xxx).
  • Run sudo fdisk /dev/xxx and create a new primary partition (enter n, p, 1, default, default).
  • Run mkfs.ext3 /dev/xxx1 to format the new partition.
  • Label the new ext3 partition using sudo e2label <new-label>
  • Refresh /dev/disk/by-uuid using sudo /etc/init.d/udev restart
  • Edit /etc/fstab to add the new partition to the list of mounts.

No comments:

Post a Comment