LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   Zfs zfs (https://www.linuxquestions.org/questions/solaris-opensolaris-20/zfs-zfs-811082/)

sang_froid 05-30-2010 10:19 AM

Zfs zfs
 
Hi

I am finding quite hard times in understanding ZFS. I was trying to learn it from Sun's documentation. But I am finding quite difficult from understanding it as it jumps directly from one place to other.

Do you have any other better sites in understanding ZFS ??

Robhogg 05-30-2010 10:38 AM

Have you tried starting with the Wikipedia article?

To be honest, I've learned ZFS as I've gone along. What is it that you're having difficulty understanding? The thing that gave me most trouble at first was the concept that it is both a filesystem, and a logical volume manager.

sang_froid 05-30-2010 06:16 PM

Dragging myself, I am slowly getting it bit by bit...

By the way, I have one question. I created mirror pool called tank


tank 767K 1.98G 0 0 7 91
mirror 767K 1.98G 0 0 7 91
c1t1d0 - - 0 0 116 95
c1t2d0 - - 0 0 78 95
---------- ----- ----- ----- ----- ----- -----

Also, there are two folders inside tank:

#zfs list
tank 762K 1.95G 21K /tank
tank/home 659K 1.95G 24K /export/zfs
tank/home/bandar 317K 1024M 317K /export/zfs/bandar


Now, when I write anything to /tank/home/bandar, it is going to write the same information to both disks c1t1d0 and c1t2d0. Am I correct ?

If so, if i remove one of the disks, I should still be able to get data. Is that true ?

And how about if I remove one of the disks and add it later again. Will it do mirroring automatically or do I need to run some commands ?





Quote:

Originally Posted by Robhogg (Post 3986324)
Have you tried starting with the Wikipedia article?

To be honest, I've learned ZFS as I've gone along. What is it that you're having difficulty understanding? The thing that gave me most trouble at first was the concept that it is both a filesystem, and diska logical volume manager.


Robhogg 05-31-2010 03:33 AM

Yes, the "mirror" in the zpool status output shows that the two disks are in a mirrored array, so the same data will be duplicated on each device. You can detach one side of the mirror, and continue to use volumes in the pool.

If you re-attach the device to the pool, it will re-silver automatically (re-mirror in ZFS speak). However, if you add it to the pool, the devices will be striped together, rather than mirrored.*

I found a reasonable looking tutorial, which may be of help. I also found a good article on the principles behind ZFS on Snoracle's BigAdmin site, though unfortunately it's quite out-of-date (pre-ZFS being bootable, for one thng).

* I made this mistake once, and In current versions of ZFS, you can't shrink a pool. The only solution was to send the data out to a file, then destroy and re-create the pool :-/.

sang_froid 05-31-2010 09:24 AM

Thank you for the information. By the way, I tried removing one of the hard drives and was still able to see data.

Next I attached the one which I just removed. Then after some time, I removed the second hard drive. In this case, I didn't see any data.

Isn't is supposed to mirror data back when I attached the first drive back ? Or do I need to run any commands to force mirroring ??

Robhogg 05-31-2010 09:42 AM

No, you shouldn't need any command to force re-mirroring.

Code:

zpool attach [-f] pool device  new_device

  Attaches new_device to an existing zpool device. The existing device cannot be part of a raidz
  configuration. If device is not currently part of a mirrored configuration, device automatically
  transforms into a two-way mirror of device and new_device. If device is part of a two-way
  mirror, attaching new_device creates a three-way mirror, and so on. In either case, new_device 
  begins to resilver immediately.

Did you try running zpool status after re-attaching the drive, and then again before detaching the other half? If you did, you should have seen a message informing you that the drive was being resilvered in the status line immediately after re-attaching. It would be wise to check before running zpool detach, though I'd be surprised if the utilities would allow you to detach a drive from a pool with inconsistencies.

salasi 05-31-2010 03:52 PM

The linked articles:

http://www.linuxquestions.org/questi...advice-700873/? Although, maybe you want specific and that is fairly general.


All times are GMT -5. The time now is 06:46 PM.