Solved Formatting disk for ZFS

Hi guys,

the handbook doesn't give any advise on how preparing a disk for ZFS, there is only this example for UFS:

Code:
# gpart create -s GPT ada1
# gpart add -t freebsd-ufs -a 1M ada1

Is it a right setting changing the example like this:

Code:
# gpart create -s GPT ada1
# gpart add -t freebsd-zfs -a 1M ada1

Thanks... 🙏
 
Greetings all,

I have an additional question. It has been recommended, cf., https://www.freebsddiary.org/zfs-with-gpart.php, to set the partition size, the idea being that the size of the same advertised size of HDDs may be slightly different, so replacing a failed HDD using the whole (raw?) HDD my cause a problem.

Although on first sight this appears to be a good general recommendation, what about a practical implementation, i.e., how to determine the partition size to account for the HDDs size difference?

I will be using two 4TB HDDs, so is , e.g., sacrificing 10MB enough?

Kindest regards,

M
 
I have used the recommendations from FreeBSD Diary for a long time. I think there is information on the internet that implies leave "10%". which at first blush sounds like a lot, but 10% of 4T? So if devices are different sizes, I would leave >= 10% of the smallest
 
I think there is information on the internet that implies leave "10%". which at first blush sounds like a lot, but 10% of 4T?
If these "opinions" are actually fact based, then that seems to suggests that, for example for a 4TB drive, there are actually drives being sold as 4TB drives that have 4TB-10% effective space. That sounds more like misinformation to me.

Edit: the internet information "like misinformation" and/or the advertisement practices "like theft" and malpractice.
 
If these "opinions" are actually fact based, then that seems to suggests that, for example for a 4TB drive, there are actually drives being sold as 4TB drives that have 4TB-10% effective space. That sounds more like misinformation to me.

Edit: the internet information "like misinformation" and/or the advertisement practices "like theft" and malpractice.
I don't know what "the" answer is, but SSDs typically reserve (by reporting less) a percentage which makes it easier on the SSD firmware to perform things like wear leveling. I'm not sure if that applies to all media types, but if there is a theoretical benefit to leaving X% outside of use so the firmware can do block reallocation, the question FOR ME is how much am I losing?
Given the size of devices now (Walmart 2TB external device are $70USD to greater) I'm merely asking "how much do you actually LOSE by reserving X%?

Call it misinformation, call it opinion, call it peanut butter cookies.
 
What is being discussed here is the difference in size between manufacturers and models.
Even if the drive is the same 4TB, there are slight differences in size, so if the new HDD you purchased is smaller, you may not be able to replace it.
The question is how to estimate that difference.
 
Greetings all,

thank you for all the replies.

I understand that there are likely no (public) data on the manufacturing size differences. I should have formulated the question to those that follow this recommendation how much do you reserve.

Kindest regards,

M
 
Although on first sight this appears to be a good general recommendation, what about a practical implementation, i.e., how to determine the partition size to account for the HDDs size difference?
Instead of "shrinking" your drives unnecessarily, that 10% would be put to much better/effective use by setting a reasonable amount as reservation, zfsprops(7):
Code:
reservation=size|none
	 The minimum amount of space guaranteed	to a dataset and  its  descen-
	 dants.	  When	the  amount  of	 space	used  is below this value, the
	 dataset is treated as if it were taking up the	amount of space	speci-
	 fied by its reservation.  Reservations	are accounted for in the  par-
	 ent datasets' space used, and count against the parent	datasets' quo-
	 tas and reservations.

	 This  property	 can also be referred to by its	shortened column name,
	 reserv.

Michael Lucas and Allan Jude in FreeBSD Mastery - Advanced ZFS:
Ideally, you should create a reservation for 20% of the capacity of your pool. You can
always lower the reservation to buy time while you work on adding more capacity or
removing old data. The last thing you want is to unexpectedly run out of space.

P.S. It seems the ZFS duo has a new ZFS book in the pipeline.
 
the reservation thing is a separate issue than what's being asked here — the goal with using a slightly smaller partition is to avoid trouble when your, e.g., 4TB disk carks it, and you buy a marketed-as-4TB drive that has a slightly different count of sectors.
 
the reservation thing is a separate issue
Yes it is; apologies for the confusion. What I meant to indicate and should have said is that in addition to making the partition resonable smaller (not the 10%, that I fully agree with "[...] seems excessively excessive") a reservation is a very usefull property. That also limits--temporarily--your storage, but reserves headroom. That headroom can be made available when necessary, that is: when you may actually be in need of a parachute; it may function as a friendly indicator why your pool is operating so slowly when it gets not enough free space to function adequately. By default it is not set (=0).
 
Greetings all,

I have an additional question. It has been recommended, cf., https://www.freebsddiary.org/zfs-with-gpart.php, to set the partition size, the idea being that the size of the same advertised size of HDDs may be slightly different, so replacing a failed HDD using the whole (raw?) HDD my cause a problem.

Although on first sight this appears to be a good general recommendation, what about a practical implementation, i.e., how to determine the partition size to account for the HDDs size difference?

I will be using two 4TB HDDs, so is , e.g., sacrificing 10MB enough?

Kindest regards,

M
I recommend replacing it with a larger hard drive.
e.g.:
You have a pool ,zdata -- Mirror ,2x4TBHD.
If one of them(ada0) is fail,replace it by a 6TB HD.
Another day, another HD(ada1)is fail,replace it by a 8TB HD.
Finally , online -e the pool, you will get a bigger pool.

another point is, from the first fail HD to the last fail HD, it maybe spend serveral years, I don't think I can remember how does I do to the pool.
 
Hi lidapeng,

although your replay does not address the issue, it is a very good strategy suggestion.

Though, I have about 8 of these (original) HGST drives that my landlord and I bought for pennies on a dollar, so maybe a better strategy would be to build a NAS, if the data grows too much.

Kindest regards,

M
 
Back
Top