[opensuse] bash scripts from file manager in kde
I have written a few bash scripts for synching files to a memory stick and I am wondering, is there a way to execute a script by making an icon and clicking on it from kde? I know how to execute the scripts from the command line using . or sh already, but I haven't been able to figure out how to execute by clicking on the file's icon. Thanks George -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/11/2011 08:27 AM, George Olson wrote:
I have written a few bash scripts for synching files to a memory stick and I am wondering, is there a way to execute a script by making an icon and clicking on it from kde? I know how to execute the scripts from the command line using . or sh already, but I haven't been able to figure out how to execute by clicking on the file's icon.
Thanks George If you use folder view, you can right click on the desktop then
Create new... --> Link To Application Is that what you are looking for? I'm assuming KDE4. You may have to play w/ Gnome a little if that's what your using. -- Michael S. Dunsavage -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/11/2011 11:26 PM, Michael S. Dunsavage wrote:
On 09/11/2011 08:27 AM, George Olson wrote:
I have written a few bash scripts for synching files to a memory stick and I am wondering, is there a way to execute a script by making an icon and clicking on it from kde? I know how to execute the scripts from the command line using . or sh already, but I haven't been able to figure out how to execute by clicking on the file's icon.
Thanks George If you use folder view, you can right click on the desktop then
Create new... --> Link To Application
Is that what you are looking for? I'm assuming KDE4. You may have to play w/ Gnome a little if that's what your using.
Yes, that worked, thanks. For a little modification, it would be helpful if I could add a command in the script program at the beginning to open up konsole (or another bash shell) and visually see the execution of the script, so that I can verify the files I want were copied. Is there an easy way to do that? George -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/11/2011 09:26 PM, George OLson wrote:
On 09/11/2011 11:26 PM, Michael S. Dunsavage wrote:
On 09/11/2011 08:27 AM, George Olson wrote:
I have written a few bash scripts for synching files to a memory stick and I am wondering, is there a way to execute a script by making an icon and clicking on it from kde? I know how to execute the scripts from the command line using . or sh already, but I haven't been able to figure out how to execute by clicking on the file's icon.
Thanks George If you use folder view, you can right click on the desktop then
Create new... --> Link To Application
Is that what you are looking for? I'm assuming KDE4. You may have to play w/ Gnome a little if that's what your using.
Yes, that worked, thanks. For a little modification, it would be helpful if I could add a command in the script program at the beginning to open up konsole (or another bash shell) and visually see the execution of the script, so that I can verify the files I want were copied.
Is there an easy way to do that? George Under the advanced button is an option to run in terminal, and you can even have it close the terminal when done.
-- Michael S. Dunsavage -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/12/2011 09:34 AM, Michael S. Dunsavage wrote:
Yes, that worked, thanks. For a little modification, it would be helpful if I could add a command in the script program at the beginning to open up konsole (or another bash shell) and visually see the execution of the script, so that I can verify the files I want were copied.
Is there an easy way to do that? George
Under the advanced button is an option to run in terminal, and you can even have it close the terminal when done.
Excellent, thanks! Runs beautifully now! George -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
I have written a few bash scripts for synching files to a memory stick and I am wondering, is there a way to execute a script by making an icon and clicking on it from kde? I know how to execute the scripts from the command line using . or sh already, but I haven't been able to figure out how to execute by clicking on the file's icon.
Thanks George
The script doesn't execute by just clicking on the file in Dolphin? And if you create a soft link to that file elsewhere, e.g., in the Desktop Folder plasmoid, should do the same. Or you can create a kmenu entry using whatever icon you like and call the script from kickoff favorites, or drag the entry to your taskbar or to the launcher plasmoid. Or you can manually create the same kind of .desktop file that kmenu does, see ~home/.local/share/applications; that .desktop file can be put anywhere and when clicked on will execute. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/11/2011 12:51 PM, dwgallien pecked at the keyboard and wrote:
I have written a few bash scripts for synching files to a memory stick and I am wondering, is there a way to execute a script by making an icon and clicking on it from kde? I know how to execute the scripts from the command line using . or sh already, but I haven't been able to figure out how to execute by clicking on the file's icon.
Thanks George
The script doesn't execute by just clicking on the file in Dolphin? And if you create a soft link to that file elsewhere, e.g., in the Desktop Folder plasmoid, should do the same. Or you can create a kmenu entry using whatever icon you like and call the script from kickoff favorites, or drag the entry to your taskbar or to the launcher plasmoid. Or you can manually create the same kind of .desktop file that kmenu does, see ~home/.local/share/applications; that .desktop file can be put anywhere and when clicked on will execute.
Make sure you set the file execute flag, chmod +x <file to execute>. -- Ken Schneider SuSe since Version 5.2, June 1998 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/12/2011 01:24 AM, Ken Schneider - openSUSE wrote:
Make sure you set the file execute flag, chmod +x <file to execute>.
For some reason I don't seem to have to do that. Here are my permissions: -rw-r--r-- 1 george users 440 Sep 12 09:23 ASUStoKING.sh Yet the file executes no problem both from the konsole and linking to application as described in the earlier post. I am not logged in as root either when I try to run it, just a normal user. I did a google search for why and someone wrote that because shell commands can be executed from the command line without setting permissions, a shell script can do the same. Does that sound right to you guys? In any case, my script executes, and I don't have the permission to execute flag set on that file. George -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/11/2011 09:38 PM, George OLson wrote:
On 09/12/2011 01:24 AM, Ken Schneider - openSUSE wrote:
Make sure you set the file execute flag, chmod +x <file to execute>.
For some reason I don't seem to have to do that.
Here are my permissions: -rw-r--r-- 1 george users 440 Sep 12 09:23 ASUStoKING.sh
Yet the file executes no problem both from the konsole and linking to application as described in the earlier post. I am not logged in as root either when I try to run it, just a normal user.
I did a google search for why and someone wrote that because shell commands can be executed from the command line without setting permissions, a shell script can do the same. Does that sound right to you guys? In any case, my script executes, and I don't have the permission to execute flag set on that file.
George You can run a command without setting permissions as such from the command line:
$ bash programname however if you try $ ./programmname it will say permission denied if not marked as +x perhaps KDE reads the environment and uses the appropriate command -- Michael S. Dunsavage -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Monday 12 September 2011 02:57:38 Michael S. Dunsavage wrote:
On 09/11/2011 09:38 PM, George OLson wrote:
On 09/12/2011 01:24 AM, Ken Schneider - openSUSE wrote:
Make sure you set the file execute flag, chmod +x <file to execute>.
For some reason I don't seem to have to do that.
Here are my permissions: -rw-r--r-- 1 george users 440 Sep 12 09:23 ASUStoKING.sh
Yet the file executes no problem both from the konsole and linking to application as described in the earlier post. I am not logged in as root either when I try to run it, just a normal user.
I did a google search for why and someone wrote that because shell commands can be executed from the command line without setting permissions, a shell script can do the same. Does that sound right to you guys? In any case, my script executes, and I don't have the permission to execute flag set on that file.
George
You can run a command without setting permissions as such from the command line:
$ bash programname
however if you try
$ ./programmname it will say permission denied if not marked as +x
perhaps KDE reads the environment and uses the appropriate command
IS that not heading into dangerous territory having the ability to execute a script without the right permissions ie getting too much like windows and one of the reasons why windows is so wide open and linux has so far been top of the class this does not sound good. Pete . -- Powered by openSUSE 11.3 (x86_64) Kernel: 2.6.34.10-0.2-desktop KDE Development Platform: 4.6.00 (4.6.0) 08:12 up 8 days 13:42, 5 users, load average: 0.00, 0.00, 0.00 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/12/2011 03:14 AM, Peter Nikolic wrote:
On 09/11/2011 09:38 PM, George OLson wrote:
On 09/12/2011 01:24 AM, Ken Schneider - openSUSE wrote:
Make sure you set the file execute flag, chmod +x<file to execute>. For some reason I don't seem to have to do that.
Here are my permissions: -rw-r--r-- 1 george users 440 Sep 12 09:23 ASUStoKING.sh
Yet the file executes no problem both from the konsole and linking to application as described in the earlier post. I am not logged in as root either when I try to run it, just a normal user.
I did a google search for why and someone wrote that because shell commands can be executed from the command line without setting permissions, a shell script can do the same. Does that sound right to you guys? In any case, my script executes, and I don't have the permission to execute flag set on that file.
George You can run a command without setting permissions as such from the command line:
$ bash programname
however if you try
$ ./programmname it will say permission denied if not marked as +x
perhaps KDE reads the environment and uses the appropriate command IS that not heading into dangerous territory having the ability to execute a
On Monday 12 September 2011 02:57:38 Michael S. Dunsavage wrote: script without the right permissions ie getting too much like windows and one of the reasons why windows is so wide open and linux has so far been top of the class this does not sound good.
Pete .
You would still need the proper ownership permissions to get to the file to run it. -- Michael S. Dunsavage -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* Peter Nikolic <p.nikolic1@btinternet.com> [09-12-11 03:15]:
IS that not heading into dangerous territory having the ability to execute a script without the right permissions ie getting too much like windows and one of the reasons why windows is so wide open and linux has so far been top of the class this does not sound good.
You are not *thinking* about it. You are not actually *running* the script, you are running bash or sh which you do have permissions to execute and bash/sh is acting on the script instructions. There is no security/permissions problem, it is acting as intended. At least research the situation before making wild statements. -- (paka)Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 http://en.opensuse.org openSUSE Community Member Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/12/2011 08:17 AM, Patrick Shanahan wrote:
IS that not heading into dangerous territory having the ability to execute a script without the right permissions ie getting too much like windows and one of the reasons why windows is so wide open and linux has so far been top of the class this does not sound good. You are not *thinking* about it. You are not actually *running* the
* Peter Nikolic<p.nikolic1@btinternet.com> [09-12-11 03:15]: script, you are running bash or sh which you do have permissions to execute and bash/sh is acting on the script instructions.
There is no security/permissions problem, it is acting as intended.
At least research the situation before making wild statements.
So, even if a script was owned by root and you could access the DIR it was in, you could still execute the script? However, if I run that as my unprivileged user, would it execute the script at root privileges? IE. if there was a file called deleteroot that had rm -Rf /, and I had access to it as a regular user, but root owned deleteroot, if I $ bash deleteroot as my user, would it delete / ? Or would it still rely on that bash is being executed as a normal user? -- Michael S. Dunsavage -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Michael S. Dunsavage said the following on 09/12/2011 09:26 AM:
On 09/12/2011 08:17 AM, Patrick Shanahan wrote:
IS that not heading into dangerous territory having the ability to execute a script without the right permissions ie getting too much like windows and one of the reasons why windows is so wide open and linux has so far been top of the class this does not sound good. You are not *thinking* about it. You are not actually *running* the
* Peter Nikolic<p.nikolic1@btinternet.com> [09-12-11 03:15]: script, you are running bash or sh which you do have permissions to execute and bash/sh is acting on the script instructions.
There is no security/permissions problem, it is acting as intended.
At least research the situation before making wild statements.
So, even if a script was owned by root and you could access the DIR it was in, you could still execute the script? However, if I run that as my unprivileged user, would it execute the script at root privileges?
There you go again. It is not being executed. It is being read and interpreted. At least that's what happening with any sh $FILE if you can read it you can squirt it though the shell. See my earlier post and RTFM.
IE. if there was a file called deleteroot that had rm -Rf /, and I had access to it as a regular user, but root owned deleteroot, if I
$ bash deleteroot
as my user, would it delete / ?
No, because its the process that counts. Look: you can, as a regular user, read all the files in /etc/init.d/ They are all owned by root. They are shell scripts. Some are not marked executable. Some contain commands that can be only executed as root For example /etc/init.d/nfs is readable ls -l nfs -rwxr--r-- 1 root root 9046 Jul 1 17:12 nfs but has a line in it mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs If you try executing that script in the way you've described you will get mount: only root can do that Can you make scripts setUID? Possibly, but that has nothing to do with the approach we are discussing here. You need to get your mind right and RTFM about the shell and what 'execute' rather than 'interpret' means and read up on not just the shell but RTFM on the 'execl(2)' family. -- There is no legitimate religion apart from truth. --John Calvin -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/12/2011 09:56 AM, Anton Aylward wrote:
Michael S. Dunsavage said the following on 09/12/2011 09:26 AM:
On 09/12/2011 08:17 AM, Patrick Shanahan wrote:
IS that not heading into dangerous territory having the ability to execute a script without the right permissions ie getting too much like windows and one of the reasons why windows is so wide open and linux has so far been top of the class this does not sound good. You are not *thinking* about it. You are not actually *running* the
* Peter Nikolic<p.nikolic1@btinternet.com> [09-12-11 03:15]: script, you are running bash or sh which you do have permissions to execute and bash/sh is acting on the script instructions.
There is no security/permissions problem, it is acting as intended.
At least research the situation before making wild statements.
So, even if a script was owned by root and you could access the DIR it was in, you could still execute the script? However, if I run that as my unprivileged user, would it execute the script at root privileges?
There you go again. It is not being executed. It is being read and interpreted. At least that's what happening with any
sh $FILE
if you can read it you can squirt it though the shell. See my earlier post and RTFM.
IE. if there was a file called deleteroot that had rm -Rf /, and I had access to it as a regular user, but root owned deleteroot, if I
$ bash deleteroot
as my user, would it delete / ?
No, because its the process that counts.
Look: you can, as a regular user, read all the files in /etc/init.d/ They are all owned by root. They are shell scripts. Some are not marked executable. Some contain commands that can be only executed as root
For example /etc/init.d/nfs is readable ls -l nfs -rwxr--r-- 1 root root 9046 Jul 1 17:12 nfs but has a line in it
mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
If you try executing that script in the way you've described you will get
mount: only root can do that
Can you make scripts setUID? Possibly, but that has nothing to do with the approach we are discussing here. You need to get your mind right and RTFM about the shell and what 'execute' rather than 'interpret' means and read up on not just the shell but RTFM on the 'execl(2)' family.
I get it now. Thanx for that information, pleasantly delivered. -- Michael S. Dunsavage -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Patrick Shanahan said the following on 09/12/2011 08:17 AM:
* Peter Nikolic<p.nikolic1@btinternet.com> [09-12-11 03:15]:
IS that not heading into dangerous territory having the ability to execute a script without the right permissions ie getting too much like windows and one of the reasons why windows is so wide open and linux has so far been top of the class this does not sound good.
You are not *thinking* about it. You are not actually *running* the script, you are running bash or sh which you do have permissions to execute and bash/sh is acting on the script instructions.
The shell is a command interpreter. Not a line internperter,; it can handle structured programs. It can handle this from the console. You can enter 'if', 'for' and all the rest, at the console. Find a small shell script and try entering from the console. Now try cat smallscript.sh | sh or sh < smallscript.sh So long as 'smallscript.sh' is readable its execute permissions are irrelevant. Those are syntactically equivilent to sh smallscript.sh Please read the man page on the shell. Right there at the beginning: <quote> Bash is an sh-compatible command language interpreter that executes commands read from the standard input or from a file. </quote> and <quote> If arguments remain after option processing, and neither the -c nor the -s option has been supplied, the first argument is assumed to be the name of a file containing shell commands. </quote>
There is no security/permissions problem, it is acting as intended.
At least research the situation before making wild statements.
As in RTFM. -- "On two occasions I have been asked (by members of Parliament!), 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage 1791-1871) English computer pioneer, philosopher -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/12/2011 12:51 AM, dwgallien wrote:
I have written a few bash scripts for synching files to a memory stick and I am wondering, is there a way to execute a script by making an icon and clicking on it from kde? I know how to execute the scripts from the command line using . or sh already, but I haven't been able to figure out how to execute by clicking on the file's icon.
Thanks George
The script doesn't execute by just clicking on the file in Dolphin?
No it doesn't, kind of weird. I gave the file a ".sh" extension, and so it brings up a dialog asking if I want to install a specialized application for files of type .sh. I click on the 'no' box, and then it opens up a game I downloaded for my kids called "trackballs". (When I downloaded this game, it didn't have an icon to execute, so I went to a konsole and typed in "trackballs" on the command line to execute. For some reason trying to open a shell script in dolphin runs this game.)
And if you create a soft link to that file elsewhere, e.g., in the Desktop Folder plasmoid, should do the same.
that seemed to work Or you can create a
kmenu entry using whatever icon you like and call the script from kickoff favorites, or drag the entry to your taskbar or to the launcher plasmoid.
what exactly is the launcher plasmoid? Is that the gecko launcher in the lower left corner of my desktop? Or you can manually create the same kind of
.desktop file that kmenu does, see ~home/.local/share/applications; that .desktop file can be put anywhere and when clicked on will execute.
I will look into that one, thanks George -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/11/2011 07:27 AM, George Olson wrote:
I have written a few bash scripts for synching files to a memory stick and I am wondering, is there a way to execute a script by making an icon and clicking on it from kde? I know how to execute the scripts from the command line using . or sh already, but I haven't been able to figure out how to execute by clicking on the file's icon.
Thanks George
George, Be aware that copy, or rsync, operations directly from flash memory cards through a laptop based card reader can result in jpeg corruption. Portions of the jpeg header can be corrupted resulting in unreadable files. This can occur even though the image thumbnails are preserved intact. Always confirm that jpeg (or any images for that point) have been copied correctly by opening the image up in gimp/kview/feh whatever before overwriting the original on the memory card. I don't know why this occurs, but I have experienced this corruption a number of times copying files within bash scripts from flash cards mounted under /media/disk. Simply using a 'cp -ur filespec' can cause the problems discussed. These copy errors are unrecoverable 99% of the time. Copying from normal thumb drives that have been written to via USB don't seem to have this problem, but copying photos that have been written to the memory stick by a camera do show this type of corruption. I haven't found an answer to why this occurs. I've just gone back to using digikam to download images from cameras rather than pulling the flash card and copying the files directly from the memory stick via a card-reader and bash script. -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* David C. Rankin <drankinatty@suddenlinkmail.com> [09-12-11 10:54]:
Copying from normal thumb drives that have been written to via USB don't seem to have this problem, but copying photos that have been written to the memory stick by a camera do show this type of corruption. I haven't found an answer to why this occurs. I've just gone back to using digikam to download images from cameras rather than pulling the flash card and copying the files directly from the memory stick via a card-reader and bash script.
Odd that you have this problem. I routinely use mc to move photos from CF cards inserted into a usb-reader to my computer and have only experienced corruption when the card was removed from camera prior to completely writing the file to card (three different Nikon cameras). BUT, I always eject the card via software prior to removing it from the card-reader, and seldom format in-camera. -- (paka)Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 http://en.opensuse.org openSUSE Community Member Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/12/2011 10:53 PM, David C. Rankin wrote:
George,
Be aware that copy, or rsync, operations directly from flash memory cards through a laptop based card reader can result in jpeg corruption. Portions of the jpeg header can be corrupted resulting in unreadable files. This can occur even though the image thumbnails are preserved intact. Always confirm that jpeg (or any images for that point) have been copied correctly by opening the image up in gimp/kview/feh whatever before overwriting the original on the memory card.
I don't know why this occurs, but I have experienced this corruption a number of times copying files within bash scripts from flash cards mounted under /media/disk. Simply using a 'cp -ur filespec' can cause the problems discussed. These copy errors are unrecoverable 99% of the time.
Copying from normal thumb drives that have been written to via USB don't seem to have this problem, but copying photos that have been written to the memory stick by a camera do show this type of corruption. I haven't found an answer to why this occurs. I've just gone back to using digikam to download images from cameras rather than pulling the flash card and copying the files directly from the memory stick via a card-reader and bash script.
Wow, thanks for letting me know. I use a lot of digital images so it is good to know the best course of action. I will definitely keep this in mind. George -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 12/09/11 15:53, David C. Rankin wrote:
On 09/11/2011 07:27 AM, George Olson wrote:
I have written a few bash scripts for synching files to a memory stick and I am wondering, is there a way to execute a script by making an icon and clicking on it from kde? I know how to execute the scripts from the command line using . or sh already, but I haven't been able to figure out how to execute by clicking on the file's icon.
Thanks George
George,
Be aware that copy, or rsync, operations directly from flash memory cards through a laptop based card reader can result in jpeg corruption. Portions of the jpeg header can be corrupted resulting in unreadable files. This can occur even though the image thumbnails are preserved intact. Always confirm that jpeg (or any images for that point) have been copied correctly by opening the image up in gimp/kview/feh whatever before overwriting the original on the memory card.
I don't know why this occurs, but I have experienced this corruption a number of times copying files within bash scripts from flash cards mounted under /media/disk. Simply using a 'cp -ur filespec' can cause the problems discussed. These copy errors are unrecoverable 99% of the time.
Copying from normal thumb drives that have been written to via USB don't seem to have this problem, but copying photos that have been written to the memory stick by a camera do show this type of corruption. I haven't found an answer to why this occurs. I've just gone back to using digikam to download images from cameras rather than pulling the flash card and copying the files directly from the memory stick via a card-reader and bash script.
Are you sure you're allowing the flash drive to filesystem sync before removing it? (eject and WAIT till it's done before remove, to be extra safe go to cmdline and issue 'sync' commands.) If yes, you've discovered a weird filesystem bug which is serious business and needs to be tracked down before someone loses important data. (Or it could be a bug in your camera -- bad fs, or memory stick reader hardware or software, or even a bad memory stick?) If not, remember that reads/writes to flash media can be heavily cached to protect the limited read/write lifetimes of the drives, and you absolutely must sync / eject before removing. It's certainly not a fundamental linux problem, I've transfered to/from memory sticks written to by cameras for years with no problems. Regards, Tejas -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 9/13/2011 12:07 AM, Tejas Guruswamy wrote:
On 12/09/11 15:53, David C. Rankin wrote:
On 09/11/2011 07:27 AM, George Olson wrote:
I have written a few bash scripts for synching files to a memory stick and I am wondering, is there a way to execute a script by making an icon and clicking on it from kde? I know how to execute the scripts from the command line using . or sh already, but I haven't been able to figure out how to execute by clicking on the file's icon.
Thanks George
George,
Be aware that copy, or rsync, operations directly from flash memory cards through a laptop based card reader can result in jpeg corruption. Portions of the jpeg header can be corrupted resulting in unreadable files. This can occur even though the image thumbnails are preserved intact. Always confirm that jpeg (or any images for that point) have been copied correctly by opening the image up in gimp/kview/feh whatever before overwriting the original on the memory card.
I don't know why this occurs, but I have experienced this corruption a number of times copying files within bash scripts from flash cards mounted under /media/disk. Simply using a 'cp -ur filespec' can cause the problems discussed. These copy errors are unrecoverable 99% of the time.
Copying from normal thumb drives that have been written to via USB don't seem to have this problem, but copying photos that have been written to the memory stick by a camera do show this type of corruption. I haven't found an answer to why this occurs. I've just gone back to using digikam to download images from cameras rather than pulling the flash card and copying the files directly from the memory stick via a card-reader and bash script.
Are you sure you're allowing the flash drive to filesystem sync before removing it? (eject and WAIT till it's done before remove, to be extra safe go to cmdline and issue 'sync' commands.)
If yes, you've discovered a weird filesystem bug which is serious business and needs to be tracked down before someone loses important data. (Or it could be a bug in your camera -- bad fs, or memory stick reader hardware or software, or even a bad memory stick?) If not, remember that reads/writes to flash media can be heavily cached to protect the limited read/write lifetimes of the drives, and you absolutely must sync / eject before removing.
It's certainly not a fundamental linux problem, I've transfered to/from memory sticks written to by cameras for years with no problems.
Regards, Tejas
David's Flash cards thru a reader vs Tejas's USB sticks are two different problems. USB in all recent versions of OpenSuse mount in quick removal mode (aka synchronous mode) where the application receives indication that the write is complete only when it IS IN FACT complete, there is no caching, and files are closed and fat is written after each file. It makes for terrible performance, but its safer. With a reader, depending on how it is connected, it may not appear as USB (even if it is in fact USB), in which case all bets are off, and you have to use safely remove option. There is still a problem with Safely remove in Linux for USB. It is not the same as EJECT. There seems no way to do an eject in KDE yet. The two are quite different, EJECT is not normally done even if you click the USB applet and select what appears to be the eject icon. This is not a problem for USB sticks that are accessed in synchronous mode. But it can be a big problem for things that pretend to be USB devices, such as many android phones, Nook Ereaders, etc. For these to recognize that you are truly finished, you have to EJECT. And with KDE, You have to do this from the command line, or wait a long time for your device to quiesce. I found this out after trashing my Nook storage some time back. @Tejas: We've been around this cactus farm before: http://lists.opensuse.org/opensuse/2010-04/msg00198.html In the end, Will Stephanson confirmed my findings, and I thought this would be fixed but it still persists to this day on my Nook, and Android tablet: http://lists.opensuse.org/opensuse/2010-04/msg00215.html -- _____________________________________ ---This space for rent--- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 13/09/11 23:07, John Andersen wrote:
On 9/13/2011 12:07 AM, Tejas Guruswamy wrote:
On 12/09/11 15:53, David C. Rankin wrote:
On 09/11/2011 07:27 AM, George Olson wrote:
I have written a few bash scripts for synching files to a memory stick and I am wondering, is there a way to execute a script by making an icon and clicking on it from kde? I know how to execute the scripts from the command line using . or sh already, but I haven't been able to figure out how to execute by clicking on the file's icon.
Thanks George George,
Be aware that copy, or rsync, operations directly from flash memory cards through a laptop based card reader can result in jpeg corruption. Portions of the jpeg header can be corrupted resulting in unreadable files. This can occur even though the image thumbnails are preserved intact. Always confirm that jpeg (or any images for that point) have been copied correctly by opening the image up in gimp/kview/feh whatever before overwriting the original on the memory card.
I don't know why this occurs, but I have experienced this corruption a number of times copying files within bash scripts from flash cards mounted under /media/disk. Simply using a 'cp -ur filespec' can cause the problems discussed. These copy errors are unrecoverable 99% of the time.
Copying from normal thumb drives that have been written to via USB don't seem to have this problem, but copying photos that have been written to the memory stick by a camera do show this type of corruption. I haven't found an answer to why this occurs. I've just gone back to using digikam to download images from cameras rather than pulling the flash card and copying the files directly from the memory stick via a card-reader and bash script.
Are you sure you're allowing the flash drive to filesystem sync before removing it? (eject and WAIT till it's done before remove, to be extra safe go to cmdline and issue 'sync' commands.)
If yes, you've discovered a weird filesystem bug which is serious business and needs to be tracked down before someone loses important data. (Or it could be a bug in your camera -- bad fs, or memory stick reader hardware or software, or even a bad memory stick?) If not, remember that reads/writes to flash media can be heavily cached to protect the limited read/write lifetimes of the drives, and you absolutely must sync / eject before removing.
It's certainly not a fundamental linux problem, I've transfered to/from memory sticks written to by cameras for years with no problems.
Regards, Tejas
David's Flash cards thru a reader vs Tejas's USB sticks are two different problems.
USB in all recent versions of OpenSuse mount in quick removal mode (aka synchronous mode) where the application receives indication that the write is complete only when it IS IN FACT complete, there is no caching, and files are closed and fat is written after each file. It makes for terrible performance, but its safer.
With a reader, depending on how it is connected, it may not appear as USB (even if it is in fact USB), in which case all bets are off, and you have to use safely remove option.
There is still a problem with Safely remove in Linux for USB. It is not the same as EJECT.
There seems no way to do an eject in KDE yet. The two are quite different, EJECT is not normally done even if you click the USB applet and select what appears to be the eject icon. This is not a problem for USB sticks that are accessed in synchronous mode.
But it can be a big problem for things that pretend to be USB devices, such as many android phones, Nook Ereaders, etc.
For these to recognize that you are truly finished, you have to EJECT. And with KDE, You have to do this from the command line, or wait a long time for your device to quiesce.
I found this out after trashing my Nook storage some time back.
@Tejas: We've been around this cactus farm before: http://lists.opensuse.org/opensuse/2010-04/msg00198.html
In the end, Will Stephanson confirmed my findings, and I thought this would be fixed but it still persists to this day on my Nook, and Android tablet: http://lists.opensuse.org/opensuse/2010-04/msg00215.html
Well reminded :). Still, a 'sync' command before removal should ensure all data is completely transferred. Are there any bugs filed either with openSUSE or KDE on this issue? Regards, Tejas -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* John Andersen <jsamyth@gmail.com> [09-13-11 18:09]:
David's Flash cards thru a reader vs Tejas's USB sticks are two different problems.
maybe
USB in all recent versions of OpenSuse mount in quick removal mode (aka synchronous mode) where the application receives indication that the write is complete only when it IS IN FACT complete, there is no caching, and files are closed and fat is written after each file. It makes for terrible performance, but its safer.
I have not experienced this, but will not argue
With a reader, depending on how it is connected, it may not appear as USB (even if it is in fact USB), in which case all bets are off, and you have to use safely remove option.
There is still a problem with Safely remove in Linux for USB. It is not the same as EJECT.
Now I will argue. I have 11.4 with the "Device Notifier" applet and the "eject" indicator/icon appears to eject the device. It definitely umounts the device, and demsg confirm that. dmesg: ------------------ 1 --------------------------------- [262931.917663] sd 20:0:0:0: [sdg] 31326208 512-byte logical blocks: (16.0 GB/14.9 GiB) [262931.921142] sd 20:0:0:0: [sdg] No Caching mode page present [262931.921144] sd 20:0:0:0: [sdg] Assuming drive cache: write through [262931.925023] sd 20:0:0:0: [sdg] No Caching mode page present [262931.925027] sd 20:0:0:0: [sdg] Assuming drive cache: write through [262931.926361] sdg: sdg1 [262990.786704] sdg: detected capacity change from 16039018496 to 0 ------------------ 2 --------------------------------- [263016.705854] sd 20:0:0:0: [sdg] Spinning up disk....ready [263018.063288] sd 20:0:0:0: [sdg] 31326208 512-byte logical blocks: (16.0 GB/14.9 GiB) [263018.065759] sd 20:0:0:0: [sdg] No Caching mode page present [263018.065762] sd 20:0:0:0: [sdg] Assuming drive cache: write through [263018.069132] sd 20:0:0:0: [sdg] No Caching mode page present [263018.069137] sd 20:0:0:0: [sdg] Assuming drive cache: write through [263018.070516] sdg: sdg1 [263032.655941] sdg: detected capacity change from 16039018496 to 0 The first instance above the card was inserted in the card reader and then removed/ejected via the indicator/icon. The second instance the card was inserted in the card reader and then ejected via the cl "eject /dev/sdg1"
There seems no way to do an eject in KDE yet.
the above was performed in KDE 4.6.5
The two are quite different, EJECT is not normally done even if you click the USB applet and select what appears to be the eject icon.
not according to my experience.
This is not a problem for USB sticks that are accessed in synchronous mode. But it can be a big problem for things that pretend to be USB devices, such as many android phones, Nook Ereaders, etc.
For these to recognize that you are truly finished, you have to EJECT. And with KDE, You have to do this from the command line, or wait a long time for your device to quiesce.
I found this out after trashing my Nook storage some time back.
I have followed this procedure for several years w/o problem. I am speaking *only* about CF cards in my Stratitec multi-reader: Bus 001 Device 010: ID 05e3:0710 Genesys Logic, Inc. USB 2.0 33-in-1 Card Reader I can/will preform further tests if you wish. -- (paka)Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 http://en.opensuse.org openSUSE Community Member Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 9/13/2011 6:25 PM, Patrick Shanahan wrote:
I can/will preform further tests if you wish.
Not really necessary, as Will confirms it operates as I said. See the two links, especially the last one in my message above. As I said, this is not noticed in simple USB memory cards/sticks/etc because they are all mounted synchronously. Plug something else in there and you will see a different behavior between what that widget does and a command line umount. -- _____________________________________ ---This space for rent--- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* John Andersen <jsamyth@gmail.com> [09-13-11 21:32]:
On 9/13/2011 6:25 PM, Patrick Shanahan wrote:
I can/will preform further tests if you wish.
Not really necessary, as Will confirms it operates as I said. See the two links, especially the last one in my message above.
As I said, this is not noticed in simple USB memory cards/sticks/etc because they are all mounted synchronously. Plug something else in there and you will see a different behavior between what that widget does and a command line umount.
But David's comments related specifically to cards/cameras. Have we changed the topic? -- (paka)Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 http://en.opensuse.org openSUSE Community Member Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 9/13/2011 6:33 PM, Patrick Shanahan wrote:
* John Andersen <jsamyth@gmail.com> [09-13-11 21:32]:
On 9/13/2011 6:25 PM, Patrick Shanahan wrote:
I can/will preform further tests if you wish.
Not really necessary, as Will confirms it operates as I said. See the two links, especially the last one in my message above.
As I said, this is not noticed in simple USB memory cards/sticks/etc because they are all mounted synchronously. Plug something else in there and you will see a different behavior between what that widget does and a command line umount.
But David's comments related specifically to cards/cameras. Have we changed the topic?
With regard to cameras, you may still see a difference between safely remove icon in the widget and a real honest to god eject. I know that both my cheesy Nicon and my Olympus do not return to normal operation until I force a real Eject. Memory cards usually don't care, but I can't be sure David's reader has a usb interface, so I don't want to seem caviler with my advice, and Tejas's recommendation of a sync command before removal is well advised, especially after writing. -- _____________________________________ ---This space for rent--- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/13/2011 05:07 PM, John Andersen wrote:
David's Flash cards thru a reader vs Tejas's USB sticks are two different problems.
USB in all recent versions of OpenSuse mount in quick removal mode (aka synchronous mode) where the application receives indication that the write is complete only when it IS IN FACT complete, there is no caching, and files are closed and fat is written after each file. It makes for terrible performance, but its safer.
With a reader, depending on how it is connected, it may not appear as USB (even if it is in fact USB), in which case all bets are off, and you have to use safely remove option.
There is still a problem with Safely remove in Linux for USB. It is not the same as EJECT.
There seems no way to do an eject in KDE yet. The two are quite different, EJECT is not normally done even if you click the USB applet and select what appears to be the eject icon. This is not a problem for USB sticks that are accessed in synchronous mode.
But it can be a big problem for things that pretend to be USB devices, such as many android phones, Nook Ereaders, etc.
For these to recognize that you are truly finished, you have to EJECT. And with KDE, You have to do this from the command line, or wait a long time for your device to quiesce.
I found this out after trashing my Nook storage some time back.
I follow up a bit with Patrick on this. The card reader I have is: (from lspci) Mass storage controller: Texas Instruments 5-in-1 Multimedia Card Reader (SD/MMC/MS/MS PRO/xD) The flash drives were normal SD drives used in Kodak cameras. The drives were mounted under /media/disk. The copy from the card reader was done with 'cp -ur'. The flash drives were unmounted after the copy operation and long before the SD cards were removed from the card reader. All operations were done in the same konsole window, so the possibility of an unmount or removal of the SD drive before all operations were completed was an impossibility. (umount would fail if any files were left open or copy operations left in progress) When using the SD flash drive through the card reader, jpeg image corruption was a big issue. As mentioned, parts of the jpeg header would be preserved, but other parts were fried -- resulting in corrupt photos. Downloading the same files when the 'camera' was connected through the USB port worked fine. It was only when the SD drive connected through the card reader that corruption occurred. I never got to the bottom of this, but for George's purposes, image corruption of photos is serious enough (especially when you delete them from the flash drive before viewing them), that it was worth noting. Now, the odd part of my copy/corruption problem is that -- the full image size was copied from the SD drive to the hard drive -- but for some reason the header information was screwed. That is also on the 'unexplained' list. So I think John framed the issue correctly: copy from USB - OK copy from card reader - All bets are off Hopefully I'll have more time to dig into this issue and solve it. It was a heck of a lot quicker to pop the flash drive from the camera into the reader and launch a script that would automatically copy to the local hard drive and rsync to the local server, than it is to download the same photos through digikam and then do the same post processing on the file... -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* David C. Rankin <drankinatty@suddenlinkmail.com> [09-14-11 10:26]:
I never got to the bottom of this, but for George's purposes, image corruption of photos is serious enough (especially when you delete them from the flash drive before viewing them), that it was worth noting.
Now, the odd part of my copy/corruption problem is that -- the full image size was copied from the SD drive to the hard drive -- but for some reason the header information was screwed. That is also on the 'unexplained' list. So I think John framed the issue correctly:
copy from USB - OK
copy from card reader - All bets are off
Hopefully I'll have more time to dig into this issue and solve it. It was a heck of a lot quicker to pop the flash drive from the camera into the reader and launch a script that would automatically copy to the local hard drive and rsync to the local server, than it is to download the same photos through digikam and then do the same post processing on the file...
Sounds to me like there is a strong possibility that a problem exists with your card-reader or the connections between it and your computer..... -- (paka)Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 http://en.opensuse.org openSUSE Community Member Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wednesday, September 14, 2011 09:24:19 AM David C. Rankin wrote:
Mass storage controller: Texas Instruments 5-in-1 Multimedia Card Reader (SD/MMC/MS/MS PRO/xD) .... Now, the odd part of my copy/corruption problem is that -- the full image size was copied from the SD drive to the hard drive -- but for some reason the header information was screwed.
The driver problem? Firmware problem? It can be that begin of the file is discarded, or some garbage from previous data appended to file. I can guess that any file would be garbled it is just that card from camera has only jpeg files. Did you check file size as a trigger? Size in blocks? -- Regards, Rajko -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (12)
-
Anton Aylward
-
David C. Rankin
-
dwgallien
-
George Olson
-
George OLson
-
John Andersen
-
Ken Schneider - openSUSE
-
Michael S. Dunsavage
-
Patrick Shanahan
-
Peter Nikolic
-
Rajko M.
-
Tejas Guruswamy