Seed-device

From btrfs Wiki
(Difference between revisions)
Jump to: navigation, search
(Seed-device use example)
 
m
Line 1: Line 1:
 
 
# dd if=/dev/zero of=/mnt/gentoo/btrfs-test-1 count=2 bs=1G
 
# dd if=/dev/zero of=/mnt/gentoo/btrfs-test-1 count=2 bs=1G
 
# dd if=/dev/zero of=/mnt/gentoo/btrfs-test-2 count=2 bs=1G
 
# dd if=/dev/zero of=/mnt/gentoo/btrfs-test-2 count=2 bs=1G
Line 18: Line 17:
 
mount: block device /dev/loop0 is write-protected, mounting read-only
 
mount: block device /dev/loop0 is write-protected, mounting read-only
 
# btrfs device add /dev/loop1 /mnt/test
 
# btrfs device add /dev/loop1 /mnt/test
# cd /mnt/test/
+
# ls /mnt/test
# ls
+
 
a  b
 
a  b
# echo c > c
+
# echo c > /mnt/test/c
 
bash: c: Read-only file system
 
bash: c: Read-only file system
  
 
# mount -o remount,rw /mnt/test
 
# mount -o remount,rw /mnt/test
# echo c > c
+
OR
# echo d > d
+
# umount /mnt/test
 +
# mount /dev/loop1 /mnt/test
 +
 
 +
# echo c > /mnt/test/c
 +
# echo d > /mnt/test/d
 
# umount /mnt/test
 
# umount /mnt/test
  

Revision as of 20:38, 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. 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