To format a new drive as Btrfs (B-tree file system) and mount it in Linux, you can follow these steps:
Identify all attached drives
lsblk --output NAME,FSTYPE,LABEL,MODEL,UUID,FSAVAIL,FSUSE%,MOUNTPOINTdf -Th
Wipe drive
Unmount an already mounted drive, to able to modify its filesystem
sudo umount /dev/sdX1Wipe the filesystem from a partition
sudo wipefs -a /dev/sdX1If necessary, merge multiple partitions on the disk
sudo fdisk /dev/sdX- delete second partition:
d2 - delete first partition:
d1 - create new partition over entire disk:
n1default default - write changes to disk:
w
Format partition with filesystem
sudo mkfs.btrfs /dev/sdX1Mount drive automatically at boot
sudo nano /etc/fstab- Add text line and save
UUID=38ffd02c-c135-4aa6-8a41-494b8112a011 /media/redCloudDrive btrfs defaults,nofail 0 0
UUID=e7ec61d1-e369-4d81-b10f-dfa53f1f86c3 /media/blackBackupDrive btrfs defaults,nofail 0 0
Reboot to apply changes
sudo reboot nowTemporary mount drive
sudo mkdir /media/redCloudDrive
sudo mount /dev/sdX1 /media/redCloudDrive
List BTRFS subvolumes
sudo btrfs subvolume list /media/redCloudDriveSources:
Related:
- AI response - Format and mount new disks
[[List related notes]]Tags: Setup my PlutosCloud