These notes follow the steps outlined in our book (Soyinka), chapter 7, pp. 200-211:
If it helps:
$ su root
Take a look at what you have before you start. Pay some attention to the details:
# lsblk # fdisk -l
Note: parted is a program that manipulates disk partitions. Go ahead and read the man page on parted before you start.
# parted /dev/sda (parted) print (parted) mkpart (parted) Partion type? primary/extended? primary (parted) File system type? [ext2]? ext4 (parted) Start? 81.1GB (parted) End? 100% (parted) set 3 lvm on (parted) print (parted) quit
Note: read the man pages for pvdisplay and pvcreate before you start--just to bet a better idea, above and beyond what the book offers, of what the following two programs do.
# pvdisplay # pvcreate /dev/sda3 # pvdisplay
vgextend VG PV. (See man page, of course :)
Therefore, below, volume group name is fedora and physical volume name is, per the last set of commands, /dev/sda3.
# vgdisplay # vgextend fedora /dev/sda3 # vgdisplay
Note: man pages!!!
# lvdisplay # lvcreate -l 6285 --name var fedora # lvdisplay /dev/fedora/var
Formatting the disk: read the man pages, including
man fstab. The
restorecon command pertains to SELinux. We'll read about that later in the
# mkfs.btrfs /dev/fedora/var # mkdir /new_var # mount /dev/fedora/var /new_var/ # cp -vrp /var/* /new_var/ # mv /var/ /old_var # mkdir /var # mount --bind /new_var/ /var/ # restorecon -R /var # nano /etc/fstab
/dev/mapper/fedora-var /var btrfs defaults 1 2