Hello,
New to FreeBSD and to ZFS I did some test to better understand some concepts.
Hereunder 2 tests, then my questions.
Sorry if this thread is a bit long.
Test 1
I created a file (d1.dat), then created a zpool based on this file.
TLDR: When I move the file (d1.dat), ZFS still refers it.
Test2
Now I delete the file (dat1.dat).
TLDR: ZFS does not complain at all, moreover, I still can use the dataset created along with the pool.
PS : I did same tests with mirrored zpool (dat1.dat and dat2.dat), I obtained same results for tests 1 and 2.
Questions
Test 1
Q1: Is ZFS constantly monitoring 'pooled' file location? (but the
Q2: What would be the behavior if it was a real hardware (hot disconnection and re-connection on another slot/port)?
Q3: Is it normal that I get no warning?
Test2
Q4: Is it normal that I get no warning (i.e this file is required by an active imported zpool) when I asked for the file (dat1.dat) deletion?
Q5: Where is stored the created file (delta in the example) after the 'pooled' file (dat1.dat) deletion?
Q6: If the file (delta) is stored in memory, what if the file (delta) size exceeds available memory size ?
Pardon me if I misunderstand some ZFS concepts, then please correct me.
Regards,
Darius
New to FreeBSD and to ZFS I did some test to better understand some concepts.
Hereunder 2 tests, then my questions.
Sorry if this thread is a bit long.
Test 1
I created a file (d1.dat), then created a zpool based on this file.
TLDR: When I move the file (d1.dat), ZFS still refers it.
Code:
r# dd if=/dev/zero of=/bingo/d1.dat bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes transferred in 0.019527 secs (5369910605 bytes/sec)
r# zpool create foo /bingo/d1.dat
r# zpool status
pool: foo
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
foo ONLINE 0 0 0
/bingo/d1.dat ONLINE 0 0 0
errors: No known data errors
pool: zroot
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
nda0p3 ONLINE 0 0 0
errors: No known data errors
r#
r# touch /foo/alpha
r# touch /foo/beta
r# tree /foo
/foo
├── alpha
└── beta
1 directory, 2 files
r# mkdir /bingo/bar
r# mv /bingo/d1.dat /bingo/bar/
r# zpool status
pool: foo
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
foo ONLINE 0 0 0
/bingo/d1.dat ONLINE 0 0 0
errors: No known data errors
pool: zroot
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
nda0p3 ONLINE 0 0 0
errors: No known data errors
r#
r# touch /foo/gamma
r# tree /foo/
/foo/
├── alpha
├── beta
└── gamma
1 directory, 3 files
r# zpool export foo
r# zpool import -d /bingo/bar/ foo
r# zpool status
pool: foo
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
foo ONLINE 0 0 0
/bingo/bar/d1.dat ONLINE 0 0 0
errors: No known data errors
pool: zroot
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
nda0p3 ONLINE 0 0 0
errors: No known data errors
r# tree /foo/
/foo/
├── alpha
├── beta
└── gamma
1 directory, 3 files
Test2
Now I delete the file (dat1.dat).
TLDR: ZFS does not complain at all, moreover, I still can use the dataset created along with the pool.
Code:
r# tar -cf /bingo/babar.tar /bingo/bar/d1.dat
r# rm /bingo/bar/d1.dat
r# zpool status
pool: foo
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
foo ONLINE 0 0 0
/bingo/bar/d1.dat ONLINE 0 0 0
errors: No known data errors
pool: zroot
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
nda0p3 ONLINE 0 0 0
errors: No known data errors
r# touch /foo/delta
r# tree /foo/
/foo/
├── alpha
├── beta
├── delta
└── gamma
1 directory, 4 files
r# zpool export foo
r# zpool status
pool: zroot
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
nda0p3 ONLINE 0 0 0
errors: No known data errors
r# tar -xvf /bingo/babar.tar
x bingo/bar/d1.dat
r# zpool import -d /bingo/bar/d1.dat foo
r# zpool status
pool: foo
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
foo ONLINE 0 0 0
/bingo/bar/d1.dat ONLINE 0 0 0
errors: No known data errors
pool: zroot
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
nda0p3 ONLINE 0 0 0
errors: No known data errors
r# tree /foo/
/foo/
├── alpha
├── beta
└── gamma
1 directory, 3 files
PS : I did same tests with mirrored zpool (dat1.dat and dat2.dat), I obtained same results for tests 1 and 2.
Questions
Test 1
Q1: Is ZFS constantly monitoring 'pooled' file location? (but the
zpool status after the move still display /bingo/d1.dat ONLINE and not /bingo/bar/d1.dat ONLINE)Q2: What would be the behavior if it was a real hardware (hot disconnection and re-connection on another slot/port)?
Q3: Is it normal that I get no warning?
Test2
Q4: Is it normal that I get no warning (i.e this file is required by an active imported zpool) when I asked for the file (dat1.dat) deletion?
Q5: Where is stored the created file (delta in the example) after the 'pooled' file (dat1.dat) deletion?
Q6: If the file (delta) is stored in memory, what if the file (delta) size exceeds available memory size ?
Pardon me if I misunderstand some ZFS concepts, then please correct me.
Regards,
Darius