levi
Still fresh, damnit!
What was wrong with just doing...?
Whats the benefit of declaring a function then calling that function over just doing it?
Code:
alias cpa='cp $@; sync'
alias cpa='cp $@; sync'
function cpa() {
cp $@
echo 'asdfasdfasdf'
}
It would help a lot of people if this could be decided.Nevertheless most people have preordered 4gb and there is the question whether the 2gb units will be produced at all.
Yeah, alias doesn't do any interpretation, it literally just replaces what you type with the alias. so "cpa foo bar" gets replaced with "cp $@; sync foo bar"well i tried the alias but i can't use $@ in an alias
You can't, nor should you. The progress bar is just doing what the kernel says, and the kernel "finishes" the unsynced copy quickly: all you'd get is a progress bar zip across to 100% and then sit there for an indeterminate length of time while the sync finishes. If this is an internal disk there's no need to worry about syncing. If it's a USB drive and you want to drag, drop, and go then you should be properly ejecting it anyway. If you want a progress bar of some sort I wasn't able to find one, but you can see how many requests are left to be written with the block stats file (in_flight is what you want: when it's 0 there's nothing left to write). You could write a script that tracks this number and estimates how long it'll be to reach zero.OK - so what line can I add to which config file to have the file manager in Cinnamon DE on Debian keep the 'writing' dialog open on all removable media devices until the write/sync is complete AND not sit there doing nothing for 5-10 minutes mulling it over before writing?
You can't, nor should you. The progress bar is just doing what the kernel says, and the kernel "finishes" the unsynced copy quickly: all you'd get is a progress bar zip across to 100% and then sit there for an indeterminate length of time while the sync finishes. If this is an internal disk there's no need to worry about syncing. If it's a USB drive and you want to drag, drop, and go then you should be properly ejecting it anyway. If you want a progress bar of some sort I wasn't able to find one, but you can see how many requests are left to be written with the block stats file (in_flight is what you want: when it's 0 there's nothing left to write). You could write a script that tracks this number and estimates how long it'll be to reach zero.
If this is something you do regularly with the same USB drive you could try adding an fstab entry for the drive with the "sync" option, that'll give you the progress bar you want, but it'll be exceptionally slower than doing a copy/sync. At the very least you could add the "flush" option so you're not waiting for a few minutes before it even starts: flush causes it to start syncing almost immediately, if possible.
Of course you'll still need to unmount, just as you are meant to do on windows (at least if it's a mass storage device). In most modern file managers you just need to right click the drive icon in the list of mount points towards the left somewhere to bring up the menu containing the unmount option.
No modern linux system should lock up just because it's writing to media. That's a very old behaviour I last saw on non-multitasking kernels with non-DMA disk transfers. But yeah, if you mount with -o flush that should pretty much fix that use case, no?
Yeah, but I wouldn't advise using sync on flash based devices. It's much more efficient and promotes less write cycles if you can buffer a whole block size before writing. I've not tested it, but I hope that flush option is a happy medium between letting caches hold data for extended periods and immediately committing any changes.
Create an udev rule. You have a lot more options available to decide when to apply it as well.So where would I add -o flush to which configuration file to automatically mount with -o flush any removable media device? I.e. any device not present at boot.
That's unfortunately how it works. Everywhere. Windows and Mac too. At least with linux you've got the option of turning on the flush or sync options, and you can see the remaining requests ticking down to zero.I've seen that answer in many places across various Linux help forums and find it unacceptable, unintuitive, and generally bad for user acceptance.