Previous 10

Oct. 23rd, 2014

Eyes

Quick tip: Figuring out which ZFS snapshot is older (of the same dataset)

Task at hand: You have two snapshots, say mypool/myfs@omgwtf and mypool/myfs@kthxbye, and you need to know which one predates the other.  A common trick is to compare their creation property, which is essentially their timestamp.

Problem: creation property isn't reliable, because system clock (from which its value is captured) may go back in time, especially when NTP “steps” system clock instead of slewing it.

Solution: ZFS does keep the snapshots fully ordered, i.e. they are sequential, and the ordering between two snapshots may be determined by dry-running incremental send:

zfs send -n -i @omgwtf mypool/myfs@kthxbye
zfs send -n -i @kthxbye mypool/myfs@omgwtf

One of these commands will succeed (zero exit code) with nothing printed out; the other will fail (nonzero exit code) saying that the incremental source (the one after -i) is newer than the target.  Take the one that succeeds: Its incremental source comes before the other.

Jun. 11th, 2013

Eyes

Be specific in what you want

Chinaphotoshop.jpg

Jan. 21st, 2012

Eyes

ZFS-only installation of FreeBSD 9.0 from DVD

This is a step-by-step guide, mostly for my own reference, but you might find this useful too.

Disclaimer: This article is about clean installation of operating system, where “clean” means that, if you follow these instructions, all existing contents of the hard drive will be destroyed.  Do not follow these instructions except on an empty hard drive.  I shall not be held responsible for any loss of data.

Here be dragons (again)!Collapse )

Tags: ,

Jul. 4th, 2011

Eyes

ZFS-only installation of FreeBSD from DVD, with encrypted root pool

This is a step-by-step guide, mostly for my own reference, but you might find this useful too.

Disclaimer: This article is about clean installation of operating system, where “clean” means that, if you follow these instructions, all existing contents of the hard drive will be destroyed.  Do not follow these instructions except on an empty hard drive.  I shall not be held responsible for any loss of data.

Here be dragons!Collapse )

Tags: ,

Jan. 31st, 2011

Nodame - “Fall In Love?”

SCSI pass-through devices disappearing immediately in FreeBSD guest

This article first describes a problem of VMware ESXi 3.5 (other versions may be affected as well; feedback appreciated) which causes host-side SCSI devices, when connected to a FreeBSD guest via SCSI pass-through, to disappear immediately, presents a workaround, and discusses why it happens.

tl;drCollapse )

Oct. 28th, 2010

Eyes

Adding a new disk to a ZFS root pool on FreeBSD

Again, this is mostly for my own reference, but if you have the same problem that I had, this article may prove useful to you as well.

OpenSolaris (from which FreeBSD's ZFS codebase came from) has this limitation: The “root” pool (i.e. the one that contains a boot filesystem, specified in the bootfs pool property) can only be a simple pool or a mirrored pool, not a raidz or any other fancier type.  The main problem seems to be the OpenSolaris ZFS boot loader having trouble reading from other disks than the “boot disk”: If anything required for booting (e.g. the kernel) resides on a non-boot disk, the system fails to boot.  Yes, boo.

There is a safeguard against this in the zpool program: If you tell it to add another vdev to a root pool (that is, one with bootfs set) in a non-mirrored setup, it complains: “root pool cannot have multiple vdevs or separate logs”.

The thing is, the FreeBSD ZFS boot loader does not suffer from the same limitation as the OpenSolaris counterpart does, and the system can indeed boot from a pool with multiple top-level vdevs, or even from a raidz pool.  The boot loader enumerates all hard drives visible through BIOS, examines metadata on ZFS partition(s) on each drive to figure out which partition belongs to what pool, then mixes-and-matches them as necessary to reconstruct a complete root pool from which to boot.  In other words, it is safe to add more top-level vdevs to a FreeBSD boot pool.

Problem: The safeguard mentioned above is still present in the FreeBSD version of zpool.  Because a root pool has the bootfs property, you cannot add another disk to a non-mirrored root pool, as long as the pool has the bootfs property set.

Well, the workaround is obvious now, isn't it?  It is as simple as temporarily clearing the bootfs property, as shown in the example below where I create a new GUID partition labeled mail0-002 on the disk da1 then add it to the root pool named mail0:

Example console sessionCollapse )

Important: Do not forget to restore the bootfs property as shown in the last two commands (use the original value as returned by a previous zpool get command); the system will otherwise fail to boot.

Note that, even though you can add more disks to your root pool this way, you may still want to limit the number of devices in your root pool to a minimum.  FreeBSD's ZFS boot loader—I use gptzfsboot—seems to take a long time to examine a disk.  “mail0” shown above has 3 disks, and it already takes about 10-20 seconds for gptzfsboot to finish scanning the 3 disks for ZFS partitions and start loading the next-stage BTX loader (/boot/loader) from them.

Tags: ,

Oct. 23rd, 2010

Eyes

ZFS-only installation of FreeBSD 8.1 from DVD

Update: If you also want to encrypt everything except /boot, refer to this version.

Update: This works for FreeBSD 8.2 as well.

This is a step-by-step guide, mostly for my own reference, but you might find this useful too.

Disclaimer: This article is about clean installation of operating system, where “clean” means that, if you follow these instructions, all existing contents of the hard drive will be destroyed.  Do not follow these instructions except on an empty hard drive.  I shall not be held responsible for any loss of data.

Here be dragons!Collapse )

Tags: ,

Nov. 6th, 2008

Eyes

*meows*

*scratches 19" server rack frames*

Sep. 23rd, 2008

Eyes

*purrs*

Now that I have my new blog (bluewhitelv if you want to add) in place, I decided to turn this journal into a stream of silly one-liners.  So…

Meow.

Sep. 4th, 2008

Eyes

Clarificiation to the previous post about my OpenID

Since my OpenID (blue.white.lv) does not control bluewhitelv—despite the similarity in the name—you have two choices, both/either/neither of which you can opt for:

In other words, blue.white.lv is my reader account, whereas bluewhitelv is my writer account (so to say).

Sorry for making the whole thing a bit more complicated, but this gives more flexibility.

Tags:

Previous 10