Find new HDD and partition and format

Posted in Unix on July 29th, 2012 by phoenixdigital

List all partitions
cat /proc/partitions

List all lvm partitions
dmsetup ls
pvdisplay
vgdisplay
lvdisplay

Check drives already in use
blkid
or
ls -l /dev/disk/by-uuid/

Find the drive that is not in that list
ls -al /dev/sd*

Create partition
fdisk /dev/sd?

If you are making a primary partition larger than 2TB you will need to follow this method using gparted
http://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html

Format
mkfs -t ext4 /dev/sd?1

check for its UUID
blkid
or
ls -l /dev/disk/by-uuid/

and add to /etc/fstab
vi /etc/fstab
UUID=d002359e-307d-41d3-8b15-b234235c55a /your/mount/point ext4 defaults 1 2

Test /etc/fstab
mount -a

Create filesystem
mkfs.ext4 /dev/vg_drive3/lv_drive3

Mounting an old drive hot plugged in
vgchange -a y

Tags: , , ,

Creating, partitioning, formatting and mounting a new drive in Unix

Posted in Unix on February 9th, 2011 by phoenixdigital

When adding a new disk to a unix machine you need to follow a few simple steps to get it visible on the file system.

Read more »

Tags: , ,