Posts: 73
zpimp
Joined: 20 Jan 2014
#1
is there something in linux that can cause data corruption on copy?
im copying some files in antix from ext4 to fat32 (usb or sd) and sometimes if i unplug it imediately after copy, some files are not copied right
is there some delay, setting, buffer, cache that does this ?

heard something about drop/sync caches, dont know if that is the case

im a happy antix user, except for this, is annoying
its deffinately not hardware related

i dont unmount removable drives, cause on windows i never had problems with this
Posts: 521
Shay
Joined: 20 Apr 2015
#2
It can be real slow to right to FAT 32 at times.
And I mean slow. Learned to use unmount because of the lack of speed.
A pop up will let you know when it is ready.
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#3
yes, copying to usb uses a buffer that allows finishing the operation before the data is actually written. so what you have done is remove the stick before the copy was done.
Posts: 73
zpimp
Joined: 20 Jan 2014
#4
so how do i fix it? is there a command to write the buffer quicker? or something ?
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#5
The fix is to do a proper unmount which will flush the buffer and finish the write.

Even in windows you've just gotten lucky. Pulling a stick before a write is done is a good way to corrupt the whole files system.
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#6
zpimp wrote:
i dont unmount removable drives, cause on windows i never had problems with this
that is the problem.
Posts: 73
zpimp
Joined: 20 Jan 2014
#7
i didnt pull it before the light stopped blinking, i thought that if there is read/write thats why the usb led is blinking
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#8
You should always unmount a usb device before unplugging (that includes in windows too). antiX even has an unplug icon on the task bar.
Posts: 521
Shay
Joined: 20 Apr 2015
#9
You just learned the hard way, yes, I had learned my lesson that way too.
Posts: 73
zpimp
Joined: 20 Jan 2014
#10
thank you very much
i saw the"unplug removable device" icon only after looking carefully at the taskbar
it was always there, just didnt saw it

i think this is a major difference in functionality between windows and linux, this is probably IMO the ONLY thing windows does better
it should be written big in red everywhere for linux noobs: if working with usb drives, remember to unmount before unplug or it can produce data loss/corruption __{{emoticon}}__

on spaceFM i have 2 options on usb drive
a). remove/eject
b). unmount

couple of questions:
1). what is the difference
2). when to use what
3). wich is the equivalent of"unplug removable device" icon from the task bar

offtopic:
another unrelated annoyance i have with linux, wich is different from one distro to another, the copy paste feature
one is select to copy and middle click(mouse3) to paste
and another, independent ctrl-c/ctrl-v
the most annoying part of the copy/paste problem if i copy text and close the source file, the clipboard content is lost

all in all stuff i can live with
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#11
Even in windows you should always unmount a plugged in device before removing it.
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#12
zpimp wrote:thank you very much
i saw the"unplug removable device" icon only after looking carefully at the taskbar
it was always there, just didnt saw it

i think this is a major difference in functionality between windows and linux, this is probably IMO the ONLY thing windows does better
it should be written big in red everywhere for linux noobs: if working with usb drives, remember to unmount before unplug or it can produce data loss/corruption __{{emoticon}}__

on spaceFM i have 2 options on usb drive
a). remove/eject
b). unmount

couple of questions:
1). what is the difference
2). when to use what
3). wich is the equivalent of"unplug removable device" icon from the task bar

offtopic:
another unrelated annoyance i have with linux, wich is different from one distro to another, the copy paste feature
one is select to copy and middle click(mouse3) to paste
and another, independent ctrl-c/ctrl-v
the most annoying part of the copy/paste problem if i copy text and close the source file, the clipboard content is lost

all in all stuff i can live with
windows may or may not handle removable usb's better. I've destroyed sticks on windows without"ejecting" the device first. people do get away with it, buts its game of chance.

as to the spacefm options.

1. eject removes the device from /dev as well as un-mounting the device.
2. unmounting simple detaches the filesystem from the main filesystem. technically the device is still present in /dev, but its safe to remove.
3. eject I believe, although both are safe.

as to your offtopic remarks.

1. there are different shortcut keys in some distros. however, ctrl+c, ctrl+x, and ctrl+v (copy, cut, paste repectively) are pretty standard, being the same set that windows uses. terminals are the exception, where you will want to use ctrl+shift+c, etc... because the other commands do different things in a console environment. our roxterm has and edit menu with the shortcuts shown as well.

2. the clipboard is a weakness of linux distros without a"real" desktop environment like xfce, gnome, or kde running those types of services. That said, clipit is available in antiX, and will provide more robust clipboard services than the default"x" clipboard.
Posts: 73
zpimp
Joined: 20 Jan 2014
#13
thank you for clarifying things up