UFS There is a discrepancy between the amount of starting size and the space left on the disk after the creation of the UFS2 partition.

Hello.

I've just created a new UFS partition on a GPT style USB disk using the FreeBSD installer. The disk is 931 GB large but after the creation of the main partition its space is decreased to 830,1 G. I can see some hidden files, for example the .snap folder (0 MB) and the .sujournal file (32 MB). So, there is a big difference between the initial space and the space left on the disk (931-830) = 100G. I don't understand why it steals so much space. I don't see files that can steal it. And I would also been able to remove the .sujournal file because it can't be deleted with the rm command. I need every last drop of disk space. How can I achieve this goal?
 
is this correct ? it does not seem to me :

Code:
marietto@marietto:/usr/home/marietto # tune2fs -m 1 /dev/da3p1

tune2fs 1.46.5 (30-Dec-2021)


tune2fs: Bad magic number in super-block while trying to open /dev/da3p1
/dev/da3p1 contains `Unix Fast File system [v2] (little-endian) last mounted on /mnt/da3p1, last written at Tue Mar  1 15:43:46 2022, clean flag 1, readonly flag 0, number of blocks 244190636, number of data blocks 236523982, number of cylinder groups 1526, block size 32768, fragment size 4096, average file size 16384, average number of files in dir 64, pending blocks to free 0, pending inodes to free 0, system-wide uuid 0, minimum percentage of free blocks 8, TIME optimization' data
 
Oh sorry ok.

Code:
marietto@marietto:/usr/home/marietto # tunefs -m 1 /dev/da3p1

tunefs: minimum percentage of free space changes from 8% to 1%
tunefs: should optimize for space with minfree < 8%

Now,you know how to remove the .sujournal file ?
 
Code:
root@marietto:/mnt/da3p1 # rm -r .sujournal
override r-------- root/wheel schg,sunlnk,nodump,opaque for .sujournal? y
rm: .sujournal: Operation not permitted
 
I should copy a large file of the same disk size on the disk. I need to remove the .sujournal file and it fill fit perfectly there. I've found this old post :


where he says : "The "schg,sunlnk" part is your warning that it won't work; you want the chflags program" ;

so I presume that If can remove those flags,I can remove it ?
 
If you REALLY want to disable the journal of UFS (bad idea), see
 
UFS, journaling, softupdates, noasync, lots of options and depending on the exact workload of a device, you may/should disable/enable any or all of them. So my opinon only, saying that disabling UFS journaling is a bad idea is incomplete. I think grahamperrin had run into a few cases with VMs that were using UFS would have inconsistent data on them. Yes, he was doing destructive testing at the time (simulating hard power fail with no UPS), but they were still valid. Journaling requires a periodic flush of the journal (ZFS has TXGs that are analogous), one can pkg install something, then power fail just as it completes and the filesystem was not updated.
Journaling helps speed up fsck on a reboot, can help smooth out performance issues.

If you decide you don't want it, going by memory, unmount the filesystem, tunefs to disable journaling, mount the filesystem and you should be able to remove the journal file.

Keep in mind that best practices with partitioning add alignment (or should be) to partition starts and ends so you don't wind up crossing physical blocks. It won't be as much as the 10% or 8% reserved for root, but it may add up.
 
FreeBSD bug 261944 – FFS/UFS: explain soft update journaling (SUJ) in documentation and in tunefs(8)


Debatably more important: problems also occurred with real hardware (not virtualised), with a verifiably good storage device.

The most extreme example, to the best of my recollection, was with soft updates disabled (someone recommended doing so):

1646150908993.png 1646150956076.png

Simply, without being alarmist: irreparable wreckage of a previously usable installation of FreeBSD.
 
No money no party.

Is UFS essential in this case?

Code:
% zfs get compressratio
NAME                                                     PROPERTY       VALUE  SOURCE
Transcend                                                compressratio  1.53x  -
Transcend/VirtualBox                                     compressratio  1.55x  -
august                                                   compressratio  2.17x  -
august/ROOT                                              compressratio  3.41x  -
august/ROOT/n250511-5f73b3338ee-d                        compressratio  2.09x  -
august/ROOT/n250511-5f73b3338ee-d@2022-01-14-06:59:29-0  compressratio  4.89x  -
august/ROOT/n252381-75d20a5e386-b                        compressratio  1.88x  -
august/ROOT/n252450-5efa7281a79-a                        compressratio  1.88x  -
august/ROOT/n252483-c8f8299a230-b                        compressratio  1.78x  -
august/ROOT/n252505-cc68614da82-a                        compressratio  2.67x  -
august/ROOT/n252531-0ce7909cd0b-h                        compressratio  2.84x  -
august/ROOT/n252997-b6724f7004c-c                        compressratio  2.28x  -
august/ROOT/n253116-39a36707bd3-e                        compressratio  1.62x  -
august/ROOT/n253343-9835900cb95-b                        compressratio  6.80x  -
august/ROOT/n253343-9835900cb95-c                        compressratio  3.41x  -
august/ROOT/n253343-9835900cb95-c@2021-07-10-04:31:39-0  compressratio  5.49x  -
august/ROOT/n253343-9835900cb95-c@2021-11-13-15:43:33-0  compressratio  4.89x  -
august/ROOT/n253343-9835900cb95-c@2021-11-14-00:24:29-0  compressratio  4.89x  -
august/ROOT/n253343-9835900cb95-c@2022-01-14-19:27:21-0  compressratio  4.75x  -
august/ROOT/n253343-9835900cb95-c@2022-01-17-04:49:36-0  compressratio  4.75x  -
august/ROOT/n253343-9835900cb95-c@2022-01-18-14:26:02-0  compressratio  4.77x  -
august/ROOT/n253343-9835900cb95-c@2022-01-19-16:22:12-0  compressratio  4.77x  -
august/ROOT/n253343-9835900cb95-c@2022-02-07-11:25:41-0  compressratio  4.73x  -
august/ROOT/n253343-9835900cb95-c@2022-02-12-17:19:08-0  compressratio  4.73x  -
august/ROOT/n253343-9835900cb95-c@2022-02-23-00:42:44-0  compressratio  4.69x  -
august/ROOT/n253343-9835900cb95-c@2022-02-27-14:58:43-0  compressratio  4.67x  -
august/VirtualBox                                        compressratio  2.03x  -
august/iocage                                            compressratio  2.35x  -
august/iocage/download                                   compressratio  1.00x  -
august/iocage/download/12.0-RELEASE                      compressratio  1.00x  -
august/iocage/images                                     compressratio  1.00x  -
august/iocage/jails                                      compressratio  2.32x  -
august/iocage/jails/jbrowsers                            compressratio  2.32x  -
august/iocage/jails/jbrowsers/root                       compressratio  2.32x  -
august/iocage/log                                        compressratio  1.02x  -
august/iocage/releases                                   compressratio  3.06x  -
august/iocage/releases/12.0-RELEASE                      compressratio  3.06x  -
august/iocage/releases/12.0-RELEASE/root                 compressratio  3.06x  -
august/iocage/releases/12.0-RELEASE/root@jbrowsers       compressratio  3.09x  -
august/iocage/templates                                  compressratio  1.00x  -
august/jails                                             compressratio  2.98x  -
august/jails/12                                          compressratio  3.05x  -
august/jails/13                                          compressratio  2.92x  -
august/poudriere                                         compressratio  2.99x  -
august/poudriere/data                                    compressratio  3.77x  -
august/poudriere/data/.m                                 compressratio  1.00x  -
august/poudriere/data/cache                              compressratio  1.37x  -
august/poudriere/data/logs                               compressratio  11.73x  -
august/poudriere/data/packages                           compressratio  1.01x  -
august/poudriere/data/wrkdirs                            compressratio  1.00x  -
august/poudriere/jails                                   compressratio  2.50x  -
august/poudriere/jails/13r                               compressratio  2.04x  -
august/poudriere/jails/13r@clean                         compressratio  2.04x  -
august/poudriere/jails/main                              compressratio  2.97x  -
august/poudriere/jails/main@clean                        compressratio  2.97x  -
august/poudriere/ports                                   compressratio  1.80x  -
august/poudriere/ports/default                           compressratio  1.81x  -
august/poudriere/ports/portoverlay                       compressratio  1.21x  -
august/tmp                                               compressratio  1.00x  -
august/usr                                               compressratio  1.25x  -
august/usr/home                                          compressratio  1.25x  -
august/usr/home@2021-03-09-07:50-0d3b3beeb25             compressratio  1.32x  -
august/usr/ports                                         compressratio  1.11x  -
august/usr/src                                           compressratio  1.50x  -
august/var                                               compressratio  6.24x  -
august/var/audit                                         compressratio  1.00x  -
august/var/crash                                         compressratio  6.17x  -
august/var/log                                           compressratio  22.60x  -
august/var/mail                                          compressratio  12.03x  -
august/var/tmp                                           compressratio  1.00x  -
august/vm-bhyve                                          compressratio  1.00x  -
%
 
The space inside is again not enough,so I did :

Code:
marietto@marietto:/mnt # tunefs -m 0 /dev/da0p1


tunefs: minimum percentage of free space changes from 1% to 0%
tunefs: should optimize for space with minfree < 8%

but,now I see : 78.5 GiB of 284.5 GiB free (72% used) ; why I see this behavior ? The disk is 931 GB.
 
Is UFS essential in this case?

Code:
% zfs get compressratio
NAME                                                     PROPERTY       VALUE  SOURCE
Transcend                                                compressratio  1.53x  -
Transcend/VirtualBox                                     compressratio  1.55x  -
august                                                   compressratio  2.17x  -
august/ROOT                                              compressratio  3.41x  -
august/ROOT/n250511-5f73b3338ee-d                        compressratio  2.09x  -
august/ROOT/n250511-5f73b3338ee-d@2022-01-14-06:59:29-0  compressratio  4.89x  -
august/ROOT/n252381-75d20a5e386-b                        compressratio  1.88x  -
august/ROOT/n252450-5efa7281a79-a                        compressratio  1.88x  -
august/ROOT/n252483-c8f8299a230-b                        compressratio  1.78x  -
august/ROOT/n252505-cc68614da82-a                        compressratio  2.67x  -
august/ROOT/n252531-0ce7909cd0b-h                        compressratio  2.84x  -
august/ROOT/n252997-b6724f7004c-c                        compressratio  2.28x  -
august/ROOT/n253116-39a36707bd3-e                        compressratio  1.62x  -
august/ROOT/n253343-9835900cb95-b                        compressratio  6.80x  -
august/ROOT/n253343-9835900cb95-c                        compressratio  3.41x  -
august/ROOT/n253343-9835900cb95-c@2021-07-10-04:31:39-0  compressratio  5.49x  -
august/ROOT/n253343-9835900cb95-c@2021-11-13-15:43:33-0  compressratio  4.89x  -
august/ROOT/n253343-9835900cb95-c@2021-11-14-00:24:29-0  compressratio  4.89x  -
august/ROOT/n253343-9835900cb95-c@2022-01-14-19:27:21-0  compressratio  4.75x  -
august/ROOT/n253343-9835900cb95-c@2022-01-17-04:49:36-0  compressratio  4.75x  -
august/ROOT/n253343-9835900cb95-c@2022-01-18-14:26:02-0  compressratio  4.77x  -
august/ROOT/n253343-9835900cb95-c@2022-01-19-16:22:12-0  compressratio  4.77x  -
august/ROOT/n253343-9835900cb95-c@2022-02-07-11:25:41-0  compressratio  4.73x  -
august/ROOT/n253343-9835900cb95-c@2022-02-12-17:19:08-0  compressratio  4.73x  -
august/ROOT/n253343-9835900cb95-c@2022-02-23-00:42:44-0  compressratio  4.69x  -
august/ROOT/n253343-9835900cb95-c@2022-02-27-14:58:43-0  compressratio  4.67x  -
august/VirtualBox                                        compressratio  2.03x  -
august/iocage                                            compressratio  2.35x  -
august/iocage/download                                   compressratio  1.00x  -
august/iocage/download/12.0-RELEASE                      compressratio  1.00x  -
august/iocage/images                                     compressratio  1.00x  -
august/iocage/jails                                      compressratio  2.32x  -
august/iocage/jails/jbrowsers                            compressratio  2.32x  -
august/iocage/jails/jbrowsers/root                       compressratio  2.32x  -
august/iocage/log                                        compressratio  1.02x  -
august/iocage/releases                                   compressratio  3.06x  -
august/iocage/releases/12.0-RELEASE                      compressratio  3.06x  -
august/iocage/releases/12.0-RELEASE/root                 compressratio  3.06x  -
august/iocage/releases/12.0-RELEASE/root@jbrowsers       compressratio  3.09x  -
august/iocage/templates                                  compressratio  1.00x  -
august/jails                                             compressratio  2.98x  -
august/jails/12                                          compressratio  3.05x  -
august/jails/13                                          compressratio  2.92x  -
august/poudriere                                         compressratio  2.99x  -
august/poudriere/data                                    compressratio  3.77x  -
august/poudriere/data/.m                                 compressratio  1.00x  -
august/poudriere/data/cache                              compressratio  1.37x  -
august/poudriere/data/logs                               compressratio  11.73x  -
august/poudriere/data/packages                           compressratio  1.01x  -
august/poudriere/data/wrkdirs                            compressratio  1.00x  -
august/poudriere/jails                                   compressratio  2.50x  -
august/poudriere/jails/13r                               compressratio  2.04x  -
august/poudriere/jails/13r@clean                         compressratio  2.04x  -
august/poudriere/jails/main                              compressratio  2.97x  -
august/poudriere/jails/main@clean                        compressratio  2.97x  -
august/poudriere/ports                                   compressratio  1.80x  -
august/poudriere/ports/default                           compressratio  1.81x  -
august/poudriere/ports/portoverlay                       compressratio  1.21x  -
august/tmp                                               compressratio  1.00x  -
august/usr                                               compressratio  1.25x  -
august/usr/home                                          compressratio  1.25x  -
august/usr/home@2021-03-09-07:50-0d3b3beeb25             compressratio  1.32x  -
august/usr/ports                                         compressratio  1.11x  -
august/usr/src                                           compressratio  1.50x  -
august/var                                               compressratio  6.24x  -
august/var/audit                                         compressratio  1.00x  -
august/var/crash                                         compressratio  6.17x  -
august/var/log                                           compressratio  22.60x  -
august/var/mail                                          compressratio  12.03x  -
august/var/tmp                                           compressratio  1.00x  -
august/vm-bhyve                                          compressratio  1.00x  -
%

I didn't find the time to learn ZFS right now.
 
Things should be done well. Journaling can't be disabled. So I'm distribuiting differently my data.
 
Things should be done well. Journaling can't be disabled. So I'm distribuiting differently my data.
Interesting. You should be able to disable journaling but I think you need to unmount the filesystem first. Of course if it's root filesystem it becomes difficult. One may have to boot a live image to do the changes.
 
In single user mode, is the root filesystem not mounted? The live image was in relation to "if you are trying to disable journaling on the root filesystem".
But yes, if it is not the root filesystem single user mode is simpler, heck if you can unmount the filesystem while in multiuser mode, you can do that.
 
Back
Top