Page MenuHomeFreeBSD

Add ZFS usage examples to the freebsd-tips file
ClosedPublic

Authored by bcr on Dec 13 2018, 6:20 PM.

Details

Summary

I've added a few tips for ZFS usage to the freebsd-tips file, which will be displayed when logging in.
I followed Dru's format of having an empty line before and after examples when appropriate. The "df -h" examples were extended to mention UFS to distinguish them from ZFS.
A few style fixes were applied as well while I was here (I can remove those if deemed necessary).
The last ZFS example was taken from a tweet by Allan Jude, I can change the attribution to him if he wants.

Test Plan

a) Apply the patch to head/usr.bin/fortune/datfiles/freebsd-tips
b) Run "make" in this directory
c) View the examples by running: fortune -m "zfs" freebsd-tips|less

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

bcr created this revision.Dec 13 2018, 6:20 PM
dru added a comment.Dec 14 2018, 7:14 PM

These look great!

bcr updated this revision to Diff 52015.Dec 14 2018, 7:17 PM

Update with suggestions by Dru.

bcr added reviewers: 0mp, avg.Dec 23 2018, 6:52 PM

Adding more reviewers for more pairs of eyes for eventual approval.

allanjude accepted this revision.Jan 15 2019, 4:06 PM
allanjude added inline comments.
head/usr.bin/fortune/datfiles/freebsd-tips
568

this is CPU threads, not necessarily real cores, not sure how best to communicate that succinctly

574

They are not necessarily inaccurate, as just confusing. As the 'size' of the disk keeps shrinking as you write to it, rather than it 'fulling up', but the current wording is probably fine.

610

this sed seems a bit risky, you might be able to constrain it to lines that END in J?

612

newsyslog does not run as a service, it is run each hour from /etc/crontab

745

Not sure if it is worth doing the other examples:

snapshot@%d deletes d and all earlier snapshots

snapshot@a% deletes a and all later snapshots

snapshot@% deletes ALL snapshots

This revision is now accepted and ready to land.Jan 15 2019, 4:06 PM
bcr added a comment.Jan 15 2019, 4:35 PM

Thanks for your feedback, @allanjude. I'll work on an updated patch that incorporates it.

head/usr.bin/fortune/datfiles/freebsd-tips
568

How about using the "sysctl -d" description: Number of active CPUs ?

574

OK, I can change it to "confusing" instead of inaccurate.

610

Yes, I had the same concerns. I look into a more precise solution that targets the end of each line.

612

That's true, although there is a service listed when I do:
service -e | grep newsyslog
But there is no such entry in /etc/rc.conf or /etc/rc.conf.local

The service method works right away, rather than waiting for the next crontab invocation. That's why I was using it.

745

Those are good examples worth mentioning (with the proper caution). I'll see if I can add them to this or create a separate one.

bcr updated this revision to Diff 52945.Jan 17 2019, 8:16 PM

Update the diff based on Allan's comments. I've decided to remove the newsyslog compression example. This might be something better suited for the handbook. In it's place, I've added Allan's zfs snapshot range deletion examples. I've also changed the date in the custom property example to a more prominent date. ;-)

This revision now requires review to proceed.Jan 17 2019, 8:16 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jan 24 2019, 6:13 PM
This revision was automatically updated to reflect the committed changes.

Thank you for the additions! Just my $0.05 worth of nit picks post commit.

head/usr.bin/fortune/datfiles/freebsd-tips
278

This reads poorly, better would be:
To see the 10 largest files IN a directory or ON a UFS partition, use

566

Not sure that available is the proper description for this item. Some of that memory is probably "in use" and not available :-) There is also hw.realmem which is the installed memory in the machine. I do get that we call this avail memory in the boot time messages, as that is the available memory for the system after kernel and boot time module loading. Some may interpret this as how to get the free memory right now, and that is not this sysctl.

574

Can we find a way to accurate describe what it is that df is displaying?

584

systat -vmstat is the much more normal useful display, I would of lead with that here.

697

examples should put options in alpha order unless they have positional parameters. I am only mentioning this once, it appears all over in this and most manpage examples, but it is a nice consitency to have