Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 23 Oct 2014, 10:10
All times are UTC - 4
 Forum index » Off-Topic Area » Security
Icon that indicates a drive read or write operation?
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [25 Posts]   Goto page: 1, 2 Next
Author Message
Jasper


Joined: 25 Apr 2010
Posts: 1144
Location: England

PostPosted: Sun 07 Jul 2013, 21:13    Post subject:  Icon that indicates a drive read or write operation?  

Might it be possible and practicable to design say, a taskbar icon which displays (or changes) when any drive reads and/or writes are occuring?

If this feature is not already available; it seems, to me, it could provide an indication of any actively illegal and unexpected external movement and it would warn a user not to try to implement wmpoweroff, wmreboot, restartwm or to unplug any flash stick or unmount a drive if any intended drive reads and/or writes are unfinished.
----------

Perhaps a desktop icon for those who hide their taskbar.
Back to top
View user's profile Send private message 
tallboy


Joined: 21 Sep 2010
Posts: 444
Location: Oslo, Norway

PostPosted: Tue 09 Jul 2013, 17:53    Post subject:  

Jasper, I may misunderstand you totally, and it is not my intention to make fun of you, but on the front of my linuxbox there is a little orange led light that flash up every time a harddisk read/write operation is performed... Cool

tallboy

_________________
True freedom is a live Puppy on a multisession CD/DVD.
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2596
Location: New Zealand

PostPosted: Tue 09 Jul 2013, 18:56    Post subject:  

Ahhh yes, but does that light operate during reads/writes to/from usb? I like Jaspers idea - some sort of indicator that data is currently being transferred (or in RAM awaiting writing to usb savefile) would be great.
Back to top
View user's profile Send private message 
Jasper


Joined: 25 Apr 2010
Posts: 1144
Location: England

PostPosted: Tue 09 Jul 2013, 20:19    Post subject:  

Hi tallboy, greengeek, et al,

A red light on my desktop tower flashes at regular intervals of about six seconds. I have read that that flashing shows some kind of hard drive activity, but I have not personally seen a detailed explanation of exactly what is, or could be, happening.

I always use a Multi-session-live-CD/DVD (as do you, tallboy) and a mounted flash stick (or sometimes two mounted flash sticks when backing-up).

Apart from the flash stick(s) it is rare for any other drive or partition to be deliberately accessed/mounted after boot-up.

This thread had its origins in my wondering if the commands wmpoweroff, wmreboot or restartwm would be automatically delayed whilst awaiting the finish of an active drive read/write operation (e.g, download or back-up). After a simple single-case test it seemed unlikely that a delay would be implemented by any of those three commands - then I also wondered about unauthorised fraudulent/stealth communication initiated by any unknown external party.

I could remove (or perhaps disable) my hard drive(s) and my Multi-session option would still work - but I have no idea if my tower light would then stop flashing. My flash sticks’ lights are out of view behind me - so a taskbar read/write warning icon would suit me ideally - but an expert opinion if that may be possible and practicable was the limit of my enquiry.

My regards

Updqte:
I have now emboldened my above conjecture - because with the benefit of helpful responses below:
that conjecture about how the poweroff and reboot commands operate was at best only partially right, but more than likely - totally wrong.

Last edited by Jasper on Thu 11 Jul 2013, 09:59; edited 1 time in total
Back to top
View user's profile Send private message 
tallboy


Joined: 21 Sep 2010
Posts: 444
Location: Oslo, Norway

PostPosted: Tue 09 Jul 2013, 21:50    Post subject:  

Hmm, I would think that I/O control for Linux devices may be possible to monitor, and I had an idea about looking for the source of the properties for one of my frequently used USB sticks (one of them actually collapsed today, RIP), but that was not very enlightening... Rolling Eyes

I think there are so many kernel related I/O operations going on between devices, that monitoring what we normally think of as reading and writing to a device may be difficult to separate from for example a monitoring function. An example may be the HDD light going on every six seconds; there is probably some exchange of info between different devices, how can that be separated from other read/write operations?

tallboy

BTW, I have often seen that a save to a USB stick will not be done right away, sometimes the writing process don't start until I unmount the stick, so there is also a possible delay to take into consideration.
properties.png
 Description   
 Filesize   12.72 KB
 Viewed   401 Time(s)

properties.png


_________________
True freedom is a live Puppy on a multisession CD/DVD.
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2260

PostPosted: Wed 10 Jul 2013, 04:06    Post subject:  

The command 'sync' will flush all disk write buffers.
Back to top
View user's profile Send private message 
gcmartin

Joined: 14 Oct 2005
Posts: 4362
Location: Earth

PostPosted: Wed 10 Jul 2013, 04:53    Post subject:  

There is a currently used technology used by differing OSes (Windows/Macs/Linuxes) that was developed years ago by IBM in conjunction with a (I believe) Stanford University Math Professor in queuing theory. That technology became known internally as "Lazy-write".

What it refers to is the ability of the use of system buffers to more efficiently dump information to a device versus writing each time an app sends data to the I/O subsystem. It is deemed to be better utilization on both the system and the HDD devices.

Developers and administrators in the Linux world understand this system design and frequently will make use of the sync command to flush buffers out to the target device rather than wait for some normal system operations to handle this data movement. There are other varied reasons when this technique will be used, as well. Similar things are done as well by the other OSes.

This happens in the background, for the most part, and users almost never see this or notice this activity. And, on some very rare occasions (like unexpected power loss) will a HDD/USB be left with some tidy up operations that need be done on system reboots.

Hope this helps

_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engine or use DogPile
Back to top
View user's profile Send private message 
Jasper


Joined: 25 Apr 2010
Posts: 1144
Location: England

PostPosted: Wed 10 Jul 2013, 18:16    Post subject:  

Hi amigo et al,

Thank you all for your comments. However, I do not fully understand the sync command and would appreciate elaboration,

I follow that the buffers already in RAM are written to disk, but what if I'm near the start of a copy and paste where the data to be copied is hugely larger than my RAM - so presumably most of that data is not yet buffered.

Does sync queue a subsequent poweroffwm (or rebootwm) until all the data intended to be copied is actually pasted?

My regards
Back to top
View user's profile Send private message 
RetroTechGuy


Joined: 15 Dec 2009
Posts: 2668
Location: USA

PostPosted: Wed 10 Jul 2013, 18:31    Post subject:  

Jasper wrote:
Hi amigo et al,

Thank you all for your comments. However, I do not fully understand the sync command and would appreciate elaboration,

I follow that the buffers already in RAM are written to disk, but what if I'm near the start of a copy and paste where the data to be copied is hugely larger than my RAM - so presumably most of data is not yet buffered.

Does sync queue a subsequent poweroffwm (or rebootwm) until all the data intended to be copied is actually pasted?

My regards


In Linux, data often resides in memory and is not written to the HDD. This is particularly true in Puppy, where the writes are limited to prevent wearing out the USB flash media.

A "sync" command tells the system to stop storing that data in RAM, and write the data to the HDD (or flash drive). That memory is then released (and the data resides only on the HDD).

I believe that if your data copy is larger than RAM, it will typically just be stored in swap (virtual RAM), until physically flushed onto the HDD.

_________________
Add swapfile
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2596
Location: New Zealand

PostPosted: Thu 11 Jul 2013, 01:57    Post subject:  

Jasper wrote:
Does sync queue a subsequent poweroffwm (or rebootwm) until all the data intended to be copied is actually pasted?

In my experience the reboot or poweroff will not proceed until the data is finished being copied to the usb disk (I cant say if the behaviour is the same with copying to a HDD).

This is particularly noticeable with any usb stick that has a slow write speed. My suggestion is to use a cheap/slow 16GB usb stick, fit it to a usb 1.1 port, queue up 10 Puppy isos to be copied to it, then select poweroff and see what happens (try to find a usb stick that has an LED so you have a better idea what is happening...)
Back to top
View user's profile Send private message 
Jasper


Joined: 25 Apr 2010
Posts: 1144
Location: England

PostPosted: Thu 11 Jul 2013, 09:47    Post subject:  

HI greengeek,

I tried a very similar flash stick test to the test you suggested in your post immediately above.

Thank you for the idea and I'm very pleased to report that my experience was identical to yours.

My regards

It seems my conjecture about how the poweroff and reboot commands operate was at best only partially right, but more than likely - totally wrong.

Also, thanks again to all responders.
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2596
Location: New Zealand

PostPosted: Thu 11 Jul 2013, 15:17    Post subject:  

I have had problems in the past when copying large volumes of data to usb sticks that do not have an LED - at least once I have thought that the PC was hung, and pulled the stick out before the data transfer was complete. For that reason I like your original idea of having an on-screen icon that indicates that data transfer (or savefile updates) are incomplete and still queued or still active.

(Maybe also a "pupsave interval countdown timer indicator"?)
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Sat 13 Jul 2013, 20:15    Post subject:  

I have compiled xosview with only enabling the diskmeter .

dependencies are :
bash-3.00# ldd ./xosview-1.8.3-diskmeter-dyn
    linux-gate.so.1 => (0xffffe000)
    libXpm.so.4 => /usr/X11R7/lib/libXpm.so.4 (0xb7fab000)
    libX11.so.6 => /usr/X11R7/lib/libX11.so.6 (0xb7eda000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7df0000)
    libm.so.6 => /lib/libm.so.6 (0xb7dce000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb7dc3000)
    libc.so.6 => /lib/libc.so.6 (0xb7cc8000)
    libXau.so.6 => /usr/X11R7/lib/libXau.so.6 (0xb7cc5000)
    libXdmcp.so.6 => /usr/X11R7/lib/libXdmcp.so.6 (0xb7cc0000)
    libdl.so.2 => /lib/libdl.so.2 (0xb7cbc000)
    /lib/ld-linux.so.2 (0xb7fb9000)


That should show the read writes to all drives .

Homepages :
- 1.8.3 : http://sourceforge.net/projects/xosview/files/
+1.9.0 : http://www.pogo.org.uk/~mark/xosview/releases/

I have chosen the old version, because the ./configure script has been dropped since version 1.9.x

Play around with it. If it works, drop it into /root/Startup or create a tray icon to launch it .
xosview_diskmeter.jpg
 Description   
 Filesize   6.51 KB
 Viewed   229 Time(s)

xosview_diskmeter.jpg

xosview-1.8.3-diskmeter-dyn.bz2
Description 
bz2

 Download 
Filename  xosview-1.8.3-diskmeter-dyn.bz2 
Filesize  73.36 KB 
Downloaded  265 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
Jasper


Joined: 25 Apr 2010
Posts: 1144
Location: England

PostPosted: Sat 13 Jul 2013, 21:12    Post subject:  

Hi Karl,

Thank you very much. My quick tests have been excellent and I will do more extensive tests tomorrow.

My regards
Back to top
View user's profile Send private message 
Jasper


Joined: 25 Apr 2010
Posts: 1144
Location: England

PostPosted: Sun 14 Jul 2013, 09:14    Post subject:  

Hi again Karl,

After more extensive testing - your app definitely suits my own needs perfectly.

I added your app to my JWM Menu > Desktop > KGon [as the menu name].

I also tried the icon below (with your initials) which I put in /usr/local/lib/X11/mini-icons for the dual purpose of using it as my JWM menu icon and as the app/taskbar icon.

However, my eyesight is failing and I couldn't read your initials; so I settled on the other icon with the yellow plus sign.
---------------------

I have some minor suggestions in case you may like to consider them together with any of your own tweaks or other ideas posted by say, 31st July:

* perhaps make "read/write" red with " idle" remaining green [but space instead of /].

* perhaps make the graphing in your green bar red instead of blue.

* perhaps have the "zero" show in green with other numbers in red.

* perhaps sound a bark when finished.

* perhaps incorporate your own choice of icon directly into your app.

My regards and thanks
screenshot.jpg
 Description   
 Filesize   13.56 KB
 Viewed   207 Time(s)

screenshot.jpg

xosview.jpg
 Description   
 Filesize   1.92 KB
 Viewed   206 Time(s)

xosview.jpg

xosview.png
 Description   
 Filesize   2.05 KB
 Viewed   204 Time(s)

xosview.png

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [25 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Security
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1008s ][ Queries: 13 (0.0129s) ][ GZIP on ]