UFS Are UFS Snapshots safe to use?

Dear All,

my new VPS is pretty cheap in every means, FreeBSD is created by default with UFS and since the amount of RAM is only 500MB I don't think is convenient using (in terms of converting) ZFS at all.
I read the the handbook and I found some wiki pages and I get the impression that it is a very old technology, having some snapshot ability is cool, not sure if those are handy how the bectl ones, but is it still reliable? Are they going to take a large amount of space as the LVM snapshots for Linux?

Actually I noticed that the example of the handbook is taking a snapshots of /var... 🤔

Thanks!
 
Last edited:
ufs works pretty good for me. On FreeBSD, it's more reliable for preserving the integrity of files than ext4. Both of these have file damage on improper shutdowns, but on FreeBSD, ufs had way better recovery. Raid, Hammer of ZFS are said to be better than UFS. I don't see the point of redundant file systems for what can be reinstalled for ports or the base Operating system.

On a SSD harddisk, if it fails, it may not matter which of these was used. More reliable filesystems may not allow better recovery if the hard disk is that damaged. Regular SATA drives may be better for file storage. ZFS, raid and hammer may be better with use of it. If the harddrive goes down, something could be recovered with those.
 
Actually I noticed that the example of the handbook is taking a snapshots of /var... 🤔
Well there are pluses and minuses here.
/var/cache/pkg/ has all your packages in txz form. I like to keep these.
/var/log/ Well who doesn't want to keep at least some basic logs?

I tried running /var on Memory Disk from fstab to preserve writes to SSD.
It was a failure on servers where logging + leases are wanted/needed.
On workstation probably OK.

I have alternative backup tar script I have been refining through the years.
I don't save /var with that because its more archival than backup.
I just messed up last week and lost 1 weeks work due to dd my ada0 instead of ada1.
Thank goodness for backups.
 
I think it helps to know that the underlying technology behind UFS snapshots is dump(8) and restore(8).
Hmm. UFS snapshots can be used to create backups with dump.
Now looking at /usr/src/sbin/mksnap_ffs/mksnap_ffs.c I cannot recognize what you called "underlying technology".
Yes they are very safe to use.
... if taking care about the caveats:
https://www.freebsd.org/cgi/man.cgi?query=mksnap_ffs&format=html#CAVEATS said:
The disk full situation is not handled gracefully and may lead to a sys-
tem panic when no free blocks are found.

Every filesystem can have only up to 20 active snapshots. When this
limit is reached, attempting to create more snapshots fails with ENOSPC,
and mksnap_ffs reports that it is "out of space".
 
Hi guys, still have some doubts...

The handbook says how to take individual snapshots but not how to create a full system snapshot as in the "zfs/bectl".

I also found three methods and I am pretty confused...

The handbook

The People docs

The wiki

Plus I found a recap but it looks like you cannot backup "/"...

My point is I must update from 13.0 to 13.1, and if anything goes wrong I need a way to revert it. The freebsd-update creates a snapshot on zroot filesystem, does it the same over UFS?

Thanks,

F.
 
I don't use ZFS, but it may be better and simpler to use UFS for partitions (or the hardisk) that have the OS, then ZFS for partitions (or harddisks) that have important data.

You don't need to back up the parts which are the OS, because those are already backed up, and ports tree can be updated with a simple command. UFS is reliable enough for this.

The parts that may need something more reliable are copies of important configuration files, and your work which took time to make, important documents, and other important files.

Though, if a harddisk goes down, a redundant file system may not be enough, depending on how bad the hardware is damaged and if that filesystem is an SD drive. HD drives may be better for storage, as damage is more often limited. SD drives would be better for a harddisk with the OS install and ports. My SD drives have not been recoverable at all on major failures. HD drives were somewhat recoverable in my experience, when there was a total hardware failure.
 
sidetone I have to upgrade my VPS, last time I did a test it went wrong, I was able to fix it manually and eventually I created a newer VPS but for other reasons (a mistake made by on the WebUI).
 
This is the state of my VPS:
Code:
df -k
Filesystem                                1024-blocks    Used   Avail Capacity  Mounted on
/dev/ufs/rootfs                              10143476 4506784 4825216    48%    /
devfs                                               1       1       0   100%    /dev
/usr/local/bastille/releases/13.1-RELEASE    10143476 4506784 4825216    48%    /usr/local/bastille/jails/gmid/root/.bastille
/var/www                                     10143476 4506784 4825216    48%    /usr/local/bastille/jails/gmid/root/var/www
devfs                                               1       1       0   100%    /usr/local/bastille/jails/gmid/root/dev

and:
Code:
gpart show vtbd0
=>      40  20971440  vtbd0  GPT  (10G)
        40      1024      1  freebsd-boot  (512K)
      1064  20970416      2  freebsd-ufs  (10G)

I just realized I don't have any swap on my VPS... 😱
 
Clearly I didn't understand the matter... 😩

Code:
# mkdir /var/snapshot/
# mksnap_ffs /var /var/snapshot/snap
mksnap_ffs: Cannot create snapshot /var/snapshot/snap: /: Snapshots are not yet supported when running with journaled soft updates: Operation not supported

In this mailing list message is written that snapshot is disabled because the journaling and suggest to modify the handbook:


How do you take the snapshot then? 🤯🤯🤯
 
Eventually I found an article where a smart guy is using DUMP in a way that I should be able to understand (read as "replicate") by my side I have just one partition.


p.s. FreeBSD image on Vultr is poorly designed... 😑
 
chrbr

That documentation is really awesome, eventually the upgrade was fine with just some hiccups... Coming from ZFS, I hoped in some trivial commands like BECTL.

But I want learn how to create and make snapshots with UFS!
 
With UFS you can dump(8) and restore(8) a file system. This can be done incremental, too. But there is no hidden directory as .zfs where you can access the changes. The boot environment switching can be done with UFS as well. But I am not sure about the exact commands.
 
[...] That documentation is really awesome, eventually the upgrade was fine with just some hiccups... Coming from ZFS, I hoped in some trivial commands like BECTL.

But I want learn how to create and make snapshots with UFS!
I do not know the reasons why you've switched from ZFS to UFS, you may very well have had good reasons for that. However, I'm guessing it is a pretty safe bet that any fundamental addition to UFS as it is now and also any new addition that has some counter part functionality in ZFS will have to be very carefully weighed against the development costs (as in development hours available) for such an addition in functionality.

Most of the outside visible ZFS qualities, like ZFS snapshots and Boot Environments, rely heavily on the strengths and internal structures of ZFS as a filesystem based on COW(=Copy On Write) transactions with which it was designed from its inception*. UFS is pretty darn good and stable for what it is and IMHO pretty well debugged over the past decades. UFS just does not have all those ZFS fundamentals in its genes.

If you want to have the inherent quality and all of the "goodies" of ZFS, I personally see no other options then to adapt your hardware where necessary and use ZFS.

___
* See for example The Birth of ZFS by Jeff Bonwick or ZFS Internals Overview by Kirk McKusick where for example Kirk McKusick says (from about 2:58 min.):
Other things that come almost for free with a non-overwriting filesystem are snapshots. [...]
 
Erichans

The cheapest Vultr VPS has only 512MB, 10G of storage and 1 shared vCPU; the FreeBSD default image provided is based on the UFS filesytem.

I am pretty sure this would be the same even for better specs but precisely for my specs I guess that UFS is appropriate.

I am fine with this, if I manage to learn how to use dump/restore I might also doing backup even though my documentation is pretty clear and I can redo the server anytime in few moves...
 
My point is I must update from 13.0 to 13.1, and if anything goes wrong I need a way to revert it. The freebsd-update creates a snapshot on zroot filesystem, does it the same over UFS?
Remember that your Vultr VPS is also a virtual machine. You can create a snapshot using the Vultr console, and restore to that if anything goes wrong.
 
Back
Top