1 minute read

I just bought an SSD drive and I want to make sure it works best as it can.
I migrate my old / (ext4) partition to this drive.
For best performance I decide to switch to a GPT-based disk layout and use btrfs for the filesystem.\

Install SSD and configure partition table

First step is to physically install the disk into your laptop
After, boot from livecd/usb (systemrescuecd) and create GPT partition table and partitions, using gdisk (g fdisk).
Create at least two partitions!

  • ..BIOS_boot partition code: EF02 size: 1 MiB
  • ..Linux/Windows data, root partition code: 0700 size: any

! gdisk automatically aligns partitions on 2048-sector boundaries for best performance.

Format root partition as btrfs

mkfs.btrfs -L MyLinuxOS /dev/sda2

Copy data from old to new partition

Copy data from old partition to new partition using rsync with -a(rchive) option to make sure all filepermissions are preserved.

Install Grub2 on new partition

mount /dev/sda2 /mnt
mount -o bind /dev /mnt/dev
mount -t proc /proc /mnt/proc
mount -t sysfs /sys /mnt/sys
chroot /mnt
# possibly fedora specific:
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-install /dev/sda

Edit fstab to use on startup

# /etc/fstab #
LABEL=Fedora / btrfs defaults,noatime,discard,ssd 0 0

Sources