Conversation
Notices
-
Embed this notice
kaia (kaia@brotka.st)'s status on Wednesday, 23-Apr-2025 15:36:38 JST kaia
dd be like: yeah, I'm not showing you progress
pv be like: I'm instantly finished, but please let me continue for 15 minutes or else.....
:l_aaa: why linux be like that- Phantasm likes this.
-
Embed this notice
Qadse Sanur Qut ibn Quaadibz :catsader: (nerthos@shitposter.world)'s status on Wednesday, 23-Apr-2025 15:37:40 JST Qadse Sanur Qut ibn Quaadibz :catsader:
@kaia Linux is made of autism, with its good and its bad things kaia likes this. -
Embed this notice
lainy (lain@lain.com)'s status on Wednesday, 23-Apr-2025 15:39:05 JST lainy
@kaia sync; sync; sync -
Embed this notice
snacks (snacks@netzsphaere.xyz)'s status on Wednesday, 23-Apr-2025 15:59:50 JST snacks
@kaia status=progress for dd, idk what pv does, access like that should be uncached kaia likes this. -
Embed this notice
lainy (lain@lain.com)'s status on Wednesday, 23-Apr-2025 16:02:57 JST lainy
@kaia btw, if you haven't read it yet, this book is hilarious and educational, too: https://web.mit.edu/~simsong/www/ugh.pdf -
Embed this notice
Phantasm (phnt@fluffytail.org)'s status on Wednesday, 23-Apr-2025 16:03:12 JST Phantasm
@lain @kaia I see, somebody used an ancient UNIX system here. -
Embed this notice
lainy (lain@lain.com)'s status on Wednesday, 23-Apr-2025 16:03:14 JST lainy
@tedu first to sync, second if the first didn't work, third for good luck Phantasm likes this. -
Embed this notice
tedu (tedu@honk.tedunangst.com)'s status on Wednesday, 23-Apr-2025 16:03:15 JST tedu
@lain this is the way.
Phantasm likes this. -
Embed this notice
Phantasm (phnt@fluffytail.org)'s status on Wednesday, 23-Apr-2025 16:04:59 JST Phantasm
@snacks @kaia It's because pipe and I/O are buffered by default. It throws a gigabyte into the I/O buffer and then stalls for some time. With dd, you should be able to bypass that with oflag=direct. snacks likes this. -
Embed this notice
mangeurdenuage :gnu: :trisquel: :gondola_head: 🌿 :abeshinzo: :ignucius: (mangeurdenuage@shitposter.world)'s status on Wednesday, 23-Apr-2025 16:46:48 JST mangeurdenuage :gnu: :trisquel: :gondola_head: 🌿 :abeshinzo: :ignucius:
@kaia
>dd be like: yeah, I'm not showing you progress
There's the "status=progress" option.
Example:
dd if=.iso of=/dev/sd* bs=4M status=progresskaia likes this. -
Embed this notice
翠星石 (suiseiseki@freesoftwareextremist.com)'s status on Wednesday, 23-Apr-2025 19:25:56 JST 翠星石
@kaia >Linux
`dd --version`
Here, have a GNU bash function that tells you how much data Linux has claimed to have written, but hasn't in fact done so yet;
watchSync() {
watch -n1 'grep -E "(Dirty|Write)" /proc/meminfo; echo; ls /sys/block/ | while read device; do awk "{ print \"$device: \" \$9 }" "/sys/block/$device/stat"; done'
} -
Embed this notice
翠星石 (suiseiseki@freesoftwareextremist.com)'s status on Wednesday, 23-Apr-2025 19:26:28 JST 翠星石
@lain @kaia There is no point running sync more than once. -
Embed this notice
翠星石 (suiseiseki@freesoftwareextremist.com)'s status on Wednesday, 23-Apr-2025 19:28:52 JST 翠星石
@lain @kaia The book is wrong and is about seething over skill issues.
The foreword is by some genius that doesn't even realize he swapped to a Unix by surrendering his freedom to macos.
Also, GNU's Not Unix. -
Embed this notice
翠星石 (suiseiseki@freesoftwareextremist.com)'s status on Wednesday, 23-Apr-2025 19:54:36 JST 翠星石
@ullard @kaia I didn't even write it, but it is indeed quite well written. -
Embed this notice
GNU+ullard (ullard@shitposter.world)'s status on Wednesday, 23-Apr-2025 19:54:37 JST GNU+ullard
@Suiseiseki @kaia That is absolutely dreadful shell and you should be ashamed of yourself -
Embed this notice
翠星石 (suiseiseki@freesoftwareextremist.com)'s status on Wednesday, 23-Apr-2025 20:29:19 JST 翠星石
@taylan @kaia @lain >meaning it can return before the data it began flushing is done being flushed
Cursed - of course Linux would go full retard.
In my experience GNU sync has always blocked until data has been flushed.
So it needs to be `sync ; sync` to be safe huh? -
Embed this notice
Taylan (Now 18% More Deranged) (taylan@fedi.feministwiki.org)'s status on Wednesday, 23-Apr-2025 20:29:20 JST Taylan (Now 18% More Deranged)
@Suiseiseki @kaia @lain
I've been told that sync is in fact asynchronous, meaning it can return before the data it began flushing is done being flushed. But if you call it again, it must wait for the previous operation to finish before triggering another. So calling it twice ensures that the first run of sync has fully completed. -
Embed this notice
Taylan (Now 18% More Deranged) (taylan@fedi.feministwiki.org)'s status on Wednesday, 23-Apr-2025 20:47:31 JST Taylan (Now 18% More Deranged)
@Suiseiseki @kaia @lain
Hmm, according to this man page, it's actually synchronous on Linux:
https://man7.org/linux/man-pages/man2/sync.2.html
Apparently, the problem I've described is based on the guarantees (not) made by the POSIX standard.
So I guess it's important to call it twice in cross platform scripts, but on GNU+Linux it shouldn't matter.
In fact, based on the following, it seems that even the hack of calling it multiple times may not help, because this doesn't describe the behaviour that I mentioned earlier, of subsequent calls having to wait for the first to finish:
https://pubs.opengroup.org/onlinepubs/9799919799/functions/sync.html -
Embed this notice
翠星石 (suiseiseki@freesoftwareextremist.com)'s status on Wednesday, 23-Apr-2025 20:48:05 JST 翠星石
@taylan @kaia @lain GNU's not POSIX.
Scripts working fine on GNU/Linux-libre, but not on proprietary Unix-likes is a feature - so single `sync` all the way.
Such bug existed in Linux 1.3.20, but it doesn't exist anymore. -
Embed this notice
itsFriday (itsfriday@toot.community)'s status on Thursday, 24-Apr-2025 01:16:52 JST itsFriday
dd if=/dev/urandom of=/dev/null status=progress
kaia likes this.