0

I created a btrfs raid1 one by using "mkfs.btrfs /dev/sdc1 /dev/sdg1". It worked fine but next time I restarted my pc it seemed like the sdg device became sdf therefor btrfs refused to mount this raid1.

Is there a way to create this btrfs raid1 without using device mappings?

thanks

1 Answer 1

1

You will need to mount the filesystem using its UUID rather than the partition name.

To find the UUID of /dev/sdf1 use the blkid command or:

ls -l /dev/disk/by-uuid | grep sdf1

You should see that both partitions in your BTRFS RAID1 device have the same UUID. Now you can mount it like so:

mount -U uuid /mountpoint

and add it to /etc/fstab so it is mounted at boot:

UUID=uuid /mountpoint btrfs defaults 0 0
1
  • It's worth noting that this is not BTRFS-specific. The problem can and does affect any filesystem, and mounting by UUID is the correct solution in all cases.
    – Mikkel
    Jul 10, 2016 at 17:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .