Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Ad icon
Sell your Land, House on idamata.lk for FREE
sajith.xp.pk
Updated:
Thursday at 9:03 AM
Handmade Character Soft Toys
anil1961
Updated:
Tuesday at 2:11 PM
Bodim.lk out now !
Manoj Suranga Bandara
Updated:
Sunday at 3:05 AM
Power Lifting Lever Belt
SkullVamp
Updated:
Jun 13, 2026
Ad icon
port.lk Domain for sale
Lankan-Tech
Updated:
Jun 13, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
prashna walata uttara
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="WhiteWalker" data-source="post: 21057742" data-attributes="member: 548558"><p><span style="font-size: 15px">Does safely ejecting from a USB port actually do anything?</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px">Why do we need safe removal at all?</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px">Historically, Operating Systems treat disks as objects that can be trusted not to change state suddenly. When reading or writing files, the OS expects the files to remain accessible and not suddenly disappear in mid-read or mid-write. If a file is open, a program reading the file expects to be able to return to it and continue reading. Similarly, write commands may be dispatched to a writing subroutine and forgotten by the main program. If a drive disappears between the time the subroutine is called and the data is written to disk, that data is lost forever.</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px">In ye olde days, there were formal processes to physically "mount" and "unmount" storage media, and the physical act of mounting a tape or a disk pack triggered some mechanical switch to detect the presence or absence of media. Once the mechanism was engaged, the software could start to use the media (a "soft mount."). Some media even had mechanical interlock to prevent media from being ejected or removed until the software processes using the media released the lock.</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px">The Macintosh floppy and optical disk provide more modern examples of an interlocked physical and soft mount. One could only eject media through a software command, but that command might fail if some program was holding a file open on the medium. </span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px">Enter USB connected storage. There is no mechanical interlock in a USB connection to coordinate the hard and soft mount. The user can decide to rip the disk out from under the operating system at any time, and endure all manner of programs freaking out about the sudden loss of media. "Hey! I was using that!" Symptoms could include: Lost data, corrupted filesystems, crashing programs, or hanging computers requiring a reboot. A safe removal executes the "soft unmount" needed to prevent any unexpected Bad Things that may happen if a program loses its access to media.</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px">A safe removal does a few things:</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px">It flushes all active writes to disk.</span></p><p><span style="font-size: 15px">It alerts all programs (that know how to be alerted) that the disk is going away, and to take appropriate action.</span></p><p><span style="font-size: 15px">It alerts the user when programs have failed to take action, and still are holding files open.</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px">You can remove a disk at any time, but you are at the mercy of how well programs using the disk cope with the sudden disappearance of that disk.</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px">In the modern computer, many steps have been taken to defend against the capricious and careless removal of media. For example, Windows even introduced a feature called "Optimize for Quick Removal" makes sure data is written quickly instead of batched up and written efficiently. </span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px">It is very hard to get people to change habits. If you are doing exclusively reads on a media, safe removal is probably not needed. If you are doing writes, you are probably OK to skip safe removal if you haven't written recently and you aren't doing something silly like indexing that disk. </span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px">As a good friend of mine once said:</span></p><p><span style="font-size: 15px">Life is too short to safely eject the disk.</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px">However, Safe Removal does a number of important things and is, in fact, the only assuredly safe way to remove a disk. You probably don't need it most of the time, but it is a good habit to have since data loss sucks.</span></p></blockquote><p></p>
[QUOTE="WhiteWalker, post: 21057742, member: 548558"] [SIZE="4"]Does safely ejecting from a USB port actually do anything? Why do we need safe removal at all? Historically, Operating Systems treat disks as objects that can be trusted not to change state suddenly. When reading or writing files, the OS expects the files to remain accessible and not suddenly disappear in mid-read or mid-write. If a file is open, a program reading the file expects to be able to return to it and continue reading. Similarly, write commands may be dispatched to a writing subroutine and forgotten by the main program. If a drive disappears between the time the subroutine is called and the data is written to disk, that data is lost forever. In ye olde days, there were formal processes to physically "mount" and "unmount" storage media, and the physical act of mounting a tape or a disk pack triggered some mechanical switch to detect the presence or absence of media. Once the mechanism was engaged, the software could start to use the media (a "soft mount."). Some media even had mechanical interlock to prevent media from being ejected or removed until the software processes using the media released the lock. The Macintosh floppy and optical disk provide more modern examples of an interlocked physical and soft mount. One could only eject media through a software command, but that command might fail if some program was holding a file open on the medium. Enter USB connected storage. There is no mechanical interlock in a USB connection to coordinate the hard and soft mount. The user can decide to rip the disk out from under the operating system at any time, and endure all manner of programs freaking out about the sudden loss of media. "Hey! I was using that!" Symptoms could include: Lost data, corrupted filesystems, crashing programs, or hanging computers requiring a reboot. A safe removal executes the "soft unmount" needed to prevent any unexpected Bad Things that may happen if a program loses its access to media. A safe removal does a few things: It flushes all active writes to disk. It alerts all programs (that know how to be alerted) that the disk is going away, and to take appropriate action. It alerts the user when programs have failed to take action, and still are holding files open. You can remove a disk at any time, but you are at the mercy of how well programs using the disk cope with the sudden disappearance of that disk. In the modern computer, many steps have been taken to defend against the capricious and careless removal of media. For example, Windows even introduced a feature called "Optimize for Quick Removal" makes sure data is written quickly instead of batched up and written efficiently. It is very hard to get people to change habits. If you are doing exclusively reads on a media, safe removal is probably not needed. If you are doing writes, you are probably OK to skip safe removal if you haven't written recently and you aren't doing something silly like indexing that disk. As a good friend of mine once said: Life is too short to safely eject the disk. However, Safe Removal does a number of important things and is, in fact, the only assuredly safe way to remove a disk. You probably don't need it most of the time, but it is a good habit to have since data loss sucks.[/SIZE] [/QUOTE]
Insert quotes…
Verification
Dawasata paya keeyak thibeda?
Post reply
Top
Bottom