kevin@kevinokelley.com
2013-Jun-10 15:19 UTC
How to mount a copy of a disk with a Btrfs file system on it?
Consider the following environment. We have a storage array that provides its own facilities for creating snapshots, replicas, and clones. We create a Btrfs file system on a volume on one of these storage arrays, and we mount a snapshot of that volume on the same host. (The simple use-case is that the snapshot is being used to restore a set of files.) We''ve noticed two problems: 1. The dmesg log shows that the kernel recognizes the Btrfs object id for both devices. For example: [ 2920.923517] btrfs: device fsid 54c6e67c-fd51-4aed-a865-4ed4e1cd246a devid 1 transid 7 /dev/dm-2 [ 2921.007179] btrfs: device fsid 54c6e67c-fd51-4aed-a865-4ed4e1cd246a devid 1 transid 6 /dev/dm-9 If a user process modifies the original file system, the changes also appear on the snapshot. This is highly undesirable as we want to preserve the integrity of the snapshot so that it reflects the state of the volume when the snapshot was created. 2. We cannot mount the original volume read-write and mount the snapshot read-only. Is there a mount option for Btrfs that will allow us to mount the Btrfs file system and ignore the UUID on the device or allow us to assign a new (random) UUID for the volume? For example, xfs provides a mount option "-o nouuid". Gfs2 allows mount option "-o locktable=<UUID>" to specify a new locktable. Thank you. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html