Does btrfs-convert change the disk's UUID?

0

I'm thinking of converting my / from ext4 to btrfs.

Will the UUID change?

lilorox

Posted 2014-12-21T19:24:16.723

Reputation: 323

Why don’t you try on a disk image? – Daniel B – 2014-12-21T20:08:35.047

Answers

1

Unfortunately, I think the answer's yes:

# dd if=/dev/zero of=test bs=1M count=640
640+0 records in
640+0 records out
671088640 bytes (671 MB) copied, 0.396043 s, 1.7 GB/s
# LODEV=$(losetup -f --show test)
# echo $LODEV
/dev/loop0
# blkid $LODEV
# mkfs.ext4 -q $LODEV
# blkid $LODEV
/dev/loop0: UUID="f495c785-4b12-464f-b477-9320b1a1d3d7" TYPE="ext4"
# btrfs-convert $LODEV
creating btrfs metadata.
creating ext2fs image file.
cleaning up system chunk.
conversion complete.
# blkid $LODEV
/dev/loop0: UUID="e872e338-ad47-4584-813f-ede58c734d4e" UUID_SUB="998cd182-5f72-4066-b419-fe7c381b608d" TYPE="btrfs"
# losetup -d $LODEV
# rm test
#

In the dump above the uuid changed during conversion. And btrfs-convert doesn't seem to have any useful command switches (from a quick glance @ it) that would prevent this.

Btw, Ubuntu's help wiki mentions (or, rather, implies) the uuid change during conversion from ext3/4, too.

Wejn

Posted 2014-12-21T19:24:16.723

Reputation: 181