Skip to content

Latest commit

 

History

History
62 lines (44 loc) · 1.7 KB

disks.md

File metadata and controls

62 lines (44 loc) · 1.7 KB

Debian/Ubuntu

How to mount external USB disks.

Ubuntu Guide

# List available disks
fdisk -l

# Create the mount point
mkdir /data

# Mount the disk
# See guide

BTRFS

  • BTRFS
  • Why use btrfs? - Jan 2015 talk from Google engineer
    • licensing + better memory usage on linux
    • use kernel 3.14.x or >=3.16.2, avoid 3.15-3.16.1 (9:30 in video)
      • download deb packages for headers and image, then dpkg -i *.deb
    • always have backups, possibility of corruption
    • file encryption not yet supported, can use dm-crypt
    • dedup is available via experimental userland tool
    • use chattr +C /path to turn off CoW for a file or dir
    • defrag is slow, better to cp to new file and delete old:
      • cp -reflink=never file.orig file.new && rm file.orig
    • use cp -reflink src dest to copy a file or dir without duplicating underlying blocks
    • use btrfs send/receive instead of rsync (31:09 in video)
apt-get install btrfs-tools

# Init filesystem as a single disk if hardware RAID is used 
mkfs.btrfs -m single /dev/sdb

# Inspect
btrfs filesystem show

# Mount
mkdir /data
mount /dev/sdb /data

# Inspect
df -h

# Update fstab to add new disk to auto mount on boot
blkid
# Copy UUID of /dev/sdb

vim /etc/fstab
# OR vifs if available

# Add disk with UUID
# UUID=5fde56d0-b290-428c-6a3d-6787d3705c00 /data           btrfs   defaults        0       1