Skip to content

Instantly share code, notes, and snippets.

@terrancesnyder
Created June 15, 2013 19:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save terrancesnyder/5789386 to your computer and use it in GitHub Desktop.
Save terrancesnyder/5789386 to your computer and use it in GitHub Desktop.
Ubuntu add new hard-disk for HDFS drive.

HDFS Drive Install

Determine Drive

sudo lshw -C disk

Partition

sudo fdisk /dev/sdb 
<type 'n' and 'enter' for new partition>
<type 'p' for primary partition>
<type '1' to fill the entire drive with 1 partition>
<type 'w' to write partition to disk>

Format

sudo mkfs -t ext3 /dev/sdb1

Mount

$ # < grab uuid of new disk >
$ sudo blkid
$ # < create our mount point >
$ sudo mkdir /data
$ # < edit fstab for automount >
$ sudo nano -Bw /etc/fstab
   # /etc/fstab: static file system information.
   #
   # Use 'blkid' to print the universally unique identifier for a
   # device; this may be used with UUID= as a more robust way to name devices
   # that works even if disks are added and removed. See fstab(5).
   ...
   ...
   ...
   ...
   # new drive mounted to /data
   UUID=03b7775d-a9d5-4977-b054-78451fa3046a       /data   ext3    defaults        0       2
$ # < mount the drive >
$ sudo mount -a

Permissions

$ sudo chgrp plugdev /data
$ sudo chmod g+w /data
$ sudo chmod +t /data

https://help.ubuntu.com/community/UsingUUID https://help.ubuntu.com/community/InstallingANewHardDrive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment