Seed-device

From btrfs Wiki
(Difference between revisions)
Jump to: navigation, search
(Seed-device use example)

Revision as of 20:36, 14 May 2012

  1. dd if=/dev/zero of=/mnt/gentoo/btrfs-test-1 count=2 bs=1G
  2. dd if=/dev/zero of=/mnt/gentoo/btrfs-test-2 count=2 bs=1G
  1. losetup /dev/loop0 /mnt/gentoo/btrfs-test-1
  2. losetup /dev/loop1 /mnt/gentoo/btrfs-test-2
  1. mkfs.btrfs /dev/loop0
  1. mount /dev/loop0 /mnt/test/
  2. echo a > /mnt/test/a
  3. echo b > /mnt/test/b
  1. umount /mnt/test
  2. btrfstune -S 1 /dev/loop0
  1. mount /dev/loop0 /mnt/test

mount: block device /dev/loop0 is write-protected, mounting read-only

  1. btrfs device add /dev/loop1 /mnt/test
  2. cd /mnt/test/
  3. ls

a b

  1. echo c > c

bash: c: Read-only file system

  1. mount -o remount,rw /mnt/test
  2. echo c > c
  3. echo d > d
  4. umount /mnt/test
  1. mount /dev/loop0 /mnt/test

mount: block device /dev/loop0 is write-protected, mounting read-only

  1. ls /mnt/test

a b

  1. umount /mnt/test
  2. mount /dev/loop1 /mnt/test
  3. ls /mnt/test

a b c d

  1. cat /mnt/test/c

c

Personal tools