Seed-device

From btrfs Wiki
Revision as of 20:38, 14 May 2012 by Ierdnah (Talk | contribs)

Jump to: navigation, search
  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. ls /mnt/test

a b

  1. echo c > /mnt/test/c

bash: c: Read-only file system

  1. mount -o remount,rw /mnt/test

OR

  1. umount /mnt/test
  2. mount /dev/loop1 /mnt/test
  1. echo c > /mnt/test/c
  2. echo d > /mnt/test/d
  3. 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