News for hackers. Stuff that matters.
Re:Hacked Together 118 GB Floppy Disk by josteink on Friday February 26, 2016 @02:16AM (#11180223)
> If he could get the drive eject button to unmount the SD card, this would actually be more functional that current tech. It bugs me that unmounting SD cards / USB drives and physically removing it are two seperate actions.

To be fair, this was always a problem, also with old computers and OSes. There was no link between pressing eject and magical things happening in the machine to commit data. The data was simply already committed so there was no need to have any additional layers of security.

The difference between then and now is that new computers have enormous amounts of memory and use it to provide write-back caching. This means the OS can tell applications that data is committed when it's not. This is an OS level decision which is done for performance and has nothing to do with the physical eject-buttons on your devices.

You may call this a small nit, but I think it's an important one. The eject-button on old machines would suffer the exact same problems if it used an OS which offered write-back cache.

You could say old Macs didn't have this problem, which is true. But it didn't have an eject-button. It relied on the OS doing that. And then instead you had the problem of people not being able to get their disks out of their machines if the OS for some reason refused to release it (or that users didn't realize they had to drag the disk-icon to trash).

Re:Hacked Together 118 GB Floppy Disk by ttctciyf on Friday February 26, 2016 @05:36AM (#11180745)
> the problem of people not being able to get their disks out of their machines if the OS for some reason refused to release it

My first time on a Mac, about 1990, I felt pretty confident having plenty of early PC experience. A graphic designer I shared a house with had left me alone with (and permission to use) her Mac.

I quickly discerned there was no software of interest actually installed, but found a floppy that looked something like a game. It wasn't, and I went to hit the ... wait, there's no eject button?

After a fruitless few minutes during which I failed to notice the eject key on the keyboard (of all places!) I eventually opted for tweezers, and gently teased the floppy out of the drive.

Imagine my surprise when I restarted the Mac to find it was unable to start, having apparently completely forgotten about it's own HD! The thing had to go back for servicing before it would even boot properly, iirc.

My reputation as the house's resident computer expert was severely impacted, needless to say.

Re:Hacked Together 118 GB Floppy Disk by soylentcola on Friday February 26, 2016 @08:39AM (#11181264)
One of the things that drove me nuts using the earlier Macs at my college was the lack of an eject button. Sure, I understand the reasoning now, but when some crappy Hypercard project I was bungling made the computer freeze, I had no way to remove the floppy short of rebooting the whole computer and waiting or hunting around for a paperclip to push into the little manual eject hole.

Still, seeing how many people in my office will just pull USB flash drives without ejecting them I almost see the appeal now.

Re:Hacked Together 118 GB Floppy Disk by shdon on Friday February 26, 2016 @01:05PM (#11182880)
That latter bit is actually so common that Windows was changed to accommodate it, as Raymond Chen wrote at https://blogs.msdn.microsoft.com/oldnewthing/20031216-00/?p=...
Re:Hacked Together 118 GB Floppy Disk by digi_owl on Friday February 26, 2016 @05:33PM (#11184796)
I loved how only of my early optical drives had a notch tastefully designed into the front that allowed me to pry the drive open with any sufficiently rigid object, rather than deal with the "pointy thing into small hole" that everything later on had.
Re:Hacked Together 118 GB Floppy Disk by eCa on Friday February 26, 2016 @10:21AM (#11181783)
My first interaction with a Mac (late '90s), I watched the Mac user:

* Drag the disc icon to the trash can to eject the disc.

* Pull the power cord since there were no other way they knew of to turn it off.

Mac's reputation as a usable computer was severely impacted, needless to say :).

Re:Hacked Together 118 GB Floppy Disk by digi_owl on Friday February 26, 2016 @05:36PM (#11184813)
After hearing Woz talk about how the early Macs were resistant to malware because most of the OS lived in ROM, i find myself thinking that rather than the Amiga being the last of the "micros" the Mac ended up being so. This in that it was designed more like a C64 than a PC.
Re:Hacked Together 118 GB Floppy Disk by jerf on Friday February 26, 2016 @10:04AM (#11181697)
I hope that ~25 years later that these Internet points I grant you can ease the pain of your memory.
Re:Hacked Together 118 GB Floppy Disk by sucrose on Friday February 26, 2016 @09:41AM (#11181570)
I felt my face get red hot for you when I read those last lines.
Re:Hacked Together 118 GB Floppy Disk by mike_hock on Friday February 26, 2016 @05:39AM (#11180755)
We also had that fixed with CDs/DVDs when the OS could lock the drive and handle the eject button any way it liked.

I didn't quite like the way Linux handled this though, not allowing the disk to be ejected as long as any file descriptors were still open, which meant you had to hunt down the processes keeping them open.

But it would be extremely helpful for writable media like flash to be able to do full write-back caching and only flush the cache when the eject button is pressed, then EBADF any further reads or writes to any open file descriptors.

Re:Hacked Together 118 GB Floppy Disk by TazeTSchnitzel on Friday February 26, 2016 @08:26AM (#11181213)
Ooh, it'd be cool if you could do the same thing for USB drives. Perhaps some sort of claw or magnetic mechanism could hold the drive in place.
Re:Hacked Together 118 GB Floppy Disk by putterson on Friday February 26, 2016 @01:58PM (#11183243)
This makes me wonder what those two holes in the shroud of USB A style connectors are for. After a bit of googling it looks as if they are to provide a bit of tension against removal. I'm sure you could repurpose them to lock the usb drive into a USB port.
Re:Hacked Together 118 GB Floppy Disk by digi_owl on Friday February 26, 2016 @05:39PM (#11184835)
Some office ape is likely to rip the port out...
Re:Hacked Together 118 GB Floppy Disk by mike_hock on Saturday February 27, 2016 @05:19AM (#11186701)
Then take the repair costs out of his pay check, and if it happens repeatedly, let him go.
Re:Hacked Together 118 GB Floppy Disk by digi_owl on Friday February 26, 2016 @05:39PM (#11184831)
fuser * while sitting at the mountpoint usually gives a clue.

Also useful when something is hogging the audio device in /dev.

Re:Hacked Together 118 GB Floppy Disk by timthorn on Friday February 26, 2016 @02:37AM (#11180258)
The eject-button on old machines /did/ suffer the exact same problems - removing the disk whilst the activity LED was illuminated rarely ended well!
Re:Hacked Together 118 GB Floppy Disk by viraptor on Friday February 26, 2016 @03:02AM (#11180328)
I just remembered that even hard drives at some point had similar issues. Remember to park your heads before power off!
Re:Hacked Together 118 GB Floppy Disk by josteink on Friday February 26, 2016 @03:41AM (#11180443)
Good catch! I had completely forgotten about that one.

For those completely oblivious to this: This was actually not about getting data written to disk, but to physically protect the drive from its own mechanical construction. The "park" command would cause the harddrive to move its magnetic read and write-heads away from the internal platters, so that when it was powered down and the disks stopped spinning, the platters would not be damaged or experience needless tear and wear.

Yeah, I'm glad we no longer have to do that exercise.

Re:Hacked Together 118 GB Floppy Disk by fit2rule on Friday February 26, 2016 @06:11AM (#11180841)
I still type "sync;sync;sync" before I unmount something.

(This used to be how you'd tell the tape-spooler to rewind..)

Re:Hacked Together 118 GB Floppy Disk by ashmud on Friday February 26, 2016 @11:18AM (#11182164)
Reminds me: Sysinternals Sync on Windows.

Always, always sync -r after writing to a zip drive on Windows. Even minutes after you think it is finished writing, do not trust the OS to have finished flushing to disk.

Re:Hacked Together 118 GB Floppy Disk by amelius on Friday February 26, 2016 @05:26AM (#11180715)
> The difference between then and now is that new computers have enormous amounts of memory and use it to provide write-back caching.

Also, not syncing to disk immediately can improve the lifetime of flash media, which wasn't a concern in the old days.

However, I'm somewhat disappointed by current filesystems not using journaling to make it possible to pull out a USB drive without harm (other than losing the latest writes).

Re:Hacked Together 118 GB Floppy Disk by Tloewald on Friday February 26, 2016 @01:36PM (#11183104)
You could select the disk and then "Eject". Dragging to the trash was a shortcut to unmount and eject.

As for Macs not having the problem, this doesn't require qualification. Not only did Macs not have the problem, they treated disks as logical _volumes_ rather than physical devices. If you ejected a disk mid-save on a Mac it would complain, and if you inserted the wrong disk it would reject it and ask for the right one. If you did the same thing on a DOS/Windows machine it would correct the new disk (and leave the old disk corrupted too).

Similarly, you could copy files from one disk to another without having two disk drives in Finder (it was a pain in the neck, swapping the disks, but it worked). Other computers needed special software and relied on the user to insert the correct disk.

This advantage continues to this day. Windows still refers to devices by physical location.

Re:Hacked Together 118 GB Floppy Disk by digi_owl on Friday February 26, 2016 @05:45PM (#11184856)
> Windows still refers to devices by physical location.

Nope, not since NT. I learned that the hard way when moving a HDD containing Win2k around. Even though it was hooked to IDE master it would come up as D: as that was what it was assigned after it got formated with NTFS.

You can go into disk manager and assign a partition any letter than is not already in use.

You can even mount a partition into a existing FHS, much like on unix, but i can't say i have seen it used often.

Basically the letters are there for backwards compatibility.

Re:Hacked Together 118 GB Floppy Disk by jgrahamc on Friday February 26, 2016 @02:45AM (#11180273)
To be fair, this was always a problem, also with old computers and OSes. There was no link between pressing eject and magical things happening in the machine to commit data

There was on the Apple Lisa. Or rather ejecting a disk was something you did in the OS which made sure everything was written/closed before allowing the disk out.

Re:Hacked Together 118 GB Floppy Disk by josteink on Friday February 26, 2016 @02:55AM (#11180308)
Yeah I mentioned that in the end of my comment, together with the other issues that would typically lead to.

It was definitely confusing to new users: Insert a disk was something which anyone could do, since it only involved simple movement of a physical object, but ejecting it required you to know and understand the OS.

This was quite an "impedance mismatch" between what should ideally be two symmetrical actions, and I remember I had to help out my mother quite a few times :)

Re:Hacked Together 118 GB Floppy Disk by oh_sigh on Friday February 26, 2016 @08:03AM (#11181129)
You're right - the only solution would be a captive eject button, which did all of the write resolutions before allowing the disc to physically eject. And that would come with other usability problems, like users getting angry when they push eject and their card doesn't come out immediately.