HAMMER, disk mirroring and secure NFS

Tomohiro Kusumi kusumi.tomohiro at gmail.com
Sun Mar 26 06:59:07 PDT 2017


> A PFS is more like a namespace, I got that.

It's a logical separation within HAMMER's B-Tree. Things
(inode/dirents/data/etc) that belong to PFS#1 are logically clustered
within the tree, and the same for PFS#2,3,4,etc. The only different
one is PFS#0 which is what you have by default after newfs_hammer.
PFS#0 includes all the other PFSes. Having logically clustered
sub-tree and exported to userspace via PFS symlink makes
mirror-copy/etc easier to implement when there are certain target
directories that you want to copy to/from.

> Can the target PFS (the mirror) be mounted (yeah, I know, read only)

To be exact, the fs itself isn't readonly mounted (though you can
readonly mount if you want to). The fs just denies on runtime when you
try to have write access to it. In other words, PFSes within the fs
aren't (and can't be) mounted independently. They are just logical
separation within a single fs.

> and then accessed as any other filesystem, i.e. I can ls, cd and then cp a single file from the ro-pfs-mirror to another filesystem ?

Yes, you can do general POSIX like operations between this slave PFS
and other HAMMER (whether PFS#0 or other master PFS or other HAMMER
fs) or UFS, etc. You just can't do write to slave PFSes by design.


2017-03-26 16:02 GMT+03:00 Jasse Jansson <jasse at yberwaffe.com>:
>
>
> On 2017-03-26 14:41, Tomohiro Kusumi wrote:
>>
>> You can either directly copy between fses, or you can dump the binary
>> from one fs to stdout (and redirect it to a file) and later restore.
>> Both are technically the same thing.
>>
>> The source fs can be either independent fs or some master PFS within
>> the fs. This comes from the fact that PFS is technically nothing much
>> different from the default fs itself. The default fs is actually just
>> another PFS whose id is 0. The idea of PFS is quite difficult to
>> understand and there's no good written document either.
>
> A PFS is more like a namespace, I got that.
>
>> In either of above cases, you need the both source and destination to
>> be already mounted as fs, otherwise you can't copy. It's HAMMER's
>> internal id number based logical copying, but not
>> device/partition/dataset/etc based copying.
>
> Poorly worded question, apperantly. I'll try again.
>
> Can the target PFS (the mirror) be mounted (yeah, I know, read only) and
> then accessed as any other filesystem, i.e. I can ls, cd and then cp a
> single file from the ro-pfs-mirror to another filesystem ?
>
>
>>> Can the mirror copy be accessed/mounted as a separate filesystem and if
>>> so, can every file be read file-by-file or can it only be restored as the
>>> whole dataset ???
>>
>> There's no equivalent of ZFS's dataset. The whole idea is quite
>> different from ZFS even if it has some similarity in its feature.
>>
>>
>> 2017-03-26 14:52 GMT+03:00 Jasse Jansson <jasse at yberwaffe.com>:
>>>
>>>
>>> On 2017-03-26 12:14, Michael Neumann wrote:
>>>>
>>>>
>>>>> 1) On my main PC I'm planning to install DragonFlyBSD on a small SSD
>>>>> and
>>>>> use two 6TB disks for my home directory: one disk for the master PFS,
>>>>> one as a copy with HAMMER's mirror feature.
>>>>> I have a 7200 rpm Seagate IronWolf and a 5400 rpm Western Digital Red.
>>>>> Can I use them together or HAMMER's mirror feature requires (or work
>>>>> best with) identical disks (or disks from different brands but same
>>>>> speed)? If I can use them do you suggest using the faster disk for the
>>>>> master or the mirror?
>>>>
>>>> No problem here. You can even mirror over slow internet connections.
>>>> HAMMER is using logical mirroring, i.e. it creates two completely
>>>> separate file systems (with identical logical content), so neither the
>>>> physical block size, nor the speed of the disk matters. Of course you
>>>> have to give the second slower disk enough time to keep track.
>>>
>>>
>>> A related question:
>>>
>>> Can the mirror copy be accessed/mounted as a separate filesystem and if
>>> so,
>>> can every file be read file-by-file or can it only be restored as the
>>> whole
>>> dataset ???
>>>
>>> I belive that ZFS mirror-stream (or what it's called) can only be
>>> restored
>>> as the whole shebang but I have never tried it myself.
>>>
>>> Long time since I had DF installed on a computer, might mitigate this
>>> today
>>> but I don't have enough HD's to try this mirroring thing by myself right
>>> now.
>>>
>


More information about the Users mailing list