Wed 30 Sep 2015 — Mon 09 Jan 2017

The order

  1. Partition table
  2. Make partitions
  3. File system
  4. Mount

http://www.tldp.org/HOWTO/Partition/fdisk_partitioning.html

Partitioning

There are parted, gparted, fdisk and cfdisk. parted and gparted can work on disks > 2TB.

To resize a normal partition, use cfdisk to delete and recreate it. This won't lose you any information, as long as you don't also format that partition and as long as it starts from the same sector.

To resize an LVM partition:

  1. Use cfdisk to create an extra partition.
  2. Reboot
  3. Use pvcreate to initialize your new partition for LVM
  4. Use vgextend to your old volume group over your new volume group.
  5. Use lvextend –resize to extend your logical volumn to fill its volume group.

BIOS Partition

Make a small (2MB?) first partition for BIOS to use.

Formatting

Formatting tools are usually called mkfs.filesystemtype, for example mkfs.ntfs.

Swap file

There's also a mkswap utility for making a partition into a swap partition.

Mounting

Make a directory to mount to (usually inside /media).

Then run sudo mount /dev/devicename /media/mydir.

Devices are usually called sda sdb etc. Partitions are called sda1 sda2 and so on.

/etc/fstab is used to control auto mounting on boot.

Try sudo fdisk -l to see all the drives.