writing raw data to a block device
I'm trying to copy the whole contents of a CF memory card. I did a
Code:
cat /dev/sdb >file Code:
cat file >/dev/sdb Question is: is it ok to run sync? or is there another program that I should use? |
Running the "sync" command shouldn't hurt anything. You can also transfer the raw data using the "dd" command.
|
I think I didn't write correctly... sorry! I should have said: is it enough to run sync? I'm in doubt 'cause the filesystem has not been mounted.
|
What you have done with cat and sync may well work. You are asking us if it does. The best thing for you to do is test it and find out if it has done what you want to achieve (and you haven't told us what that is).
With linux, there are many ways to achieve what you want. No solution is necessarily "right", but some will be simpler or more "elegant" and robust than others. I have discovered that running sync can sometimes have unintended consequences: files that are currently open and being written to are immediately closed. This may not be what you want (what else is this multitasking (and therefore very different from windows) OS doing with other files when you issue sync?) If you want to make sure the buffers are flushed, then unmount the device when you have finished writing to it. If you just want to clone a memory card you should look at using dd. There are many long threads on this forum about using dd. There's a search button too. |
i might be missing something but
if this is something critical it would be so easy to write a little utility or alter a sysV utilty to use fflush on the stream. |
All times are GMT -5. The time now is 03:46 AM. |