So apparently you can just, type the word eject into bash and it will pop open your disk drive
from TheGingerNut@lemmy.blahaj.zone to linux@lemmy.ml on 08 Jan 00:38
https://lemmy.blahaj.zone/post/20553572

I’ve been using linux for more than a decade at this point, but in all that time I’ve rarely had a disk drive. The fact that this command exists and is just, one of the core utils included with your distro along with su and kill and mount and more is just… so beautiful. 10 years amore with this OS and I’m still learning things that the elders in the audience are snickering at me for only learning 5 minutes ago while they were popping their disk trays open with a single command back when disk drives were a non optional component.

#linux

threaded - newest

horse_battery_staple@lemmy.world on 08 Jan 00:51 next collapse

You can configure sudo, used to elevate the privileges of a command, to insult users when they type in an incorrect password.

To do so, edit the sudoers file with a tool called visudo, which edits and validates modifications to the sudo configuration file.

sudo visudo

Near the top, add a line that reads:

Defaults insults

Save and close the file.

k_rol@lemmy.ca on 08 Jan 02:05 collapse

I found out about this recently and I love it. I don’t know why I like to be insulted, it makes me laugh.

utopiah@lemmy.ml on 08 Jan 12:45 collapse

I’m sure you do, you little scum! /s

horse_battery_staple@lemmy.world on 08 Jan 13:09 collapse

Don’t ever match wits with a rutabaga

philluminati@lemmy.ml on 08 Jan 00:53 next collapse

I used to play with Linux at college back in 2002 and install the distros on the front of magazines. Eject opens the cd drive but did you know it hangs unless you umount the mount point first? Back in those days everything had to be painfully mounted and unmounted.

porous_grey_matter@lemmy.ml on 09 Jan 06:10 collapse

If you use arch (btw) it still does

bjoern_tantau@swg-empire.de on 08 Jan 01:03 next collapse

Ah, the good old days of sshing into a family member’s computer and trolling them by constantly opening and closing the drive.

eldavi@lemmy.ml on 08 Jan 02:42 next collapse

i envy you. lol

Khrux@ttrpg.network on 08 Jan 06:50 collapse

It it to wait 30 mins then do it every 10, and pop it in startup, those were the days.

The other was Free_Cupholder.EXE. I miss disk drives for this reason more than for actual use.

CameronDev@programming.dev on 08 Jan 01:32 next collapse

For a similar tool for windows, there is: www.grc.com/wizmo/wizmo.htm

bad_news@lemmy.billiam.net on 08 Jan 01:55 next collapse

Man, this takes me back, I had totally forgotten!

markstos@lemmy.world on 08 Jan 02:37 next collapse

You mean the cup holder?

teawrecks@sopuli.xyz on 08 Jan 22:54 next collapse

Bologna storage.

hakunawazo@lemmy.world on 09 Jan 06:34 collapse

The finger guillotine.

Squiddlioni@kbin.melroy.org on 08 Jan 02:45 next collapse

Almost 20 years ago I convinced my high school library to let me install Debian on one of the computer groups. I found the "eject" command, and wrote a script that just invoked it with an argument to close the tray. I named that script "inject". Being high schoolers, my friends and I made scripts to "eject" and "inject", along with various beeps, and named the scripts suggestive and tawdry things. We all had a good giggle setting the systems off on their little routines and walking away.

furrowsofar@beehaw.org on 08 Jan 04:41 collapse

Eject is not just for CDs. You still have to eject any hot mount physical media. Sadly the eject command only works in some cases. I do not think it works for hot mount SATA dives for example.

swab148@lemm.ee on 08 Jan 12:56 collapse

I want it to work for all drives. Sometimes I just wanna launch my SSD across the room for shits and giggles, is there a bash command for that yet?

CapillaryUpgrade@lemmy.sdf.org on 08 Jan 13:50 collapse

No, sadly not. Maybe it’s implemented in Fish?

swab148@lemm.ee on 08 Jan 14:16 collapse

Ooh, or maybe an oh-my-zsh plugin!

DeuxChevaux@lemmy.world on 08 Jan 05:26 next collapse

Very helpful command it was for those, whose modem had to be rebooted daily back in the day: Have a cron-job open the tray, which in turn was placed strategically so that it would hit the reset button of the modem, then close the tray. And voilà; automatic reboot of the modem. Robotics at its finest!

Anarki_@lemmy.blahaj.zone on 08 Jan 10:54 next collapse

That is fantastic.

art@lemmy.world on 09 Jan 04:13 collapse

In the early 2000s, only my rich friends had cell phones. My roommate and I both had accounts on each other’s machines so we could telnet into them on the same local network.

We used to do this all the time to each other. It was funny to us 25 years ago. It’s still funny now.

HakFoo@lemmy.sdf.org on 08 Jan 05:56 next collapse

If you have a LS-120, it will eject the floppy disc like you were on dome fancy-pants Macintosh!

Quazatron@lemmy.world on 08 Jan 08:57 collapse

I’ve never encountered another LS-120 user before. When it came out I assumed it would be the future, because 120 megabyte freaking laser assisted floppy, am I right? Turns out I was very much mistaken, and CD-R took over.

I also made the same mistake regarding CF vs SD cards.

GregorGizeh@lemmy.zip on 08 Jan 09:05 next collapse

For the next storage revolution go with the opposite of your prediction maybe

HakFoo@lemmy.sdf.org on 09 Jan 05:57 collapse

I’m hoping for MacroSD. About the size of a 3.5" floppy so you won’t lose it easily.

Seriously, it’s interesting that now that we have the tech to make a useful-capacity storage device the size of a credit card, we don’t. Not like those crappy giveaway flash drives printed with a card design, where they had a captive USB head and were 4x as thick as a card, but something with just contacts like a chip card, so you might need to use an external reader but it really preserves the wallet-size concept.

I’d love to have a cheap 16GB card in my wallet with all my health records and a cryptographically signed copy of my will as a one-stop, no cloud required, emergency kit.

markstos@lemmy.world on 08 Jan 16:44 next collapse

120 MB? That’s more than a ZipDisk!

I knew I attended a well-funded modern college because all the computers had been upgraded with ZipDrives.

Quazatron@lemmy.world on 08 Jan 21:17 collapse

Yep, Zip drives only had 100MB, the disks were clunky and were prone to get the Click of Death (not that LS-120 disks were any better in that sense, of course).

naeap@sopuli.xyz on 09 Jan 18:45 collapse

CF, or their follow-up CFast, are still in industrial PCs - at least in the Beckhoff IPCs my (ok, more like “my customers”) Automat is sporting

Used as system storage and easy to swap for the customer in regards of backups, if something breaks

akincisor@sh.itjust.works on 08 Jan 06:02 next collapse

Disk… drive?

what-year-is-it.jpeg

MonkderVierte@lemmy.ml on 08 Jan 11:06 collapse

The year to backup (rip) your DVDs.

akincisor@sh.itjust.works on 08 Jan 15:08 next collapse

I long ago moved to a pair of 4TB hdds and recently upgraded to a pair of 16TBs

Scrollone@feddit.it on 08 Jan 23:14 collapse

Oh boy I should’ve done it a long time ago.

mumblerfish@lemmy.world on 08 Jan 06:58 next collapse

They should make a usb-port with a spring in it which can be released with eject. Until then I have to be content with just making sound effects when I run eject on other devices.

Courantdair@jlai.lu on 08 Jan 08:45 next collapse

Back in networking classes we used to have entire rooms of replicated machines, all with contiguous addresses and same logins. We wrote a script to ssh into every computer of the room and eject and retract all the disk drives at the same time, it was wonderful ✨

savedbythezsh@sh.itjust.works on 09 Jan 14:01 collapse

You could’ve made music out of ejecting/retracting those all at different times!

Would’ve actually been fantastic distributed systems practice, synchronizing all of those to tight tolerances of music across a network connection…

plum@lemmy.zip on 08 Jan 09:07 next collapse

This command was very useful for quickly finding a server in a row of hundreds of identical servers. No need to read the labels or look up which rack it’s in. Just log in remotely, just use ‘eject’, and then walk down the row to the server that has its tray out.

thingsiplay@beehaw.org on 08 Jan 13:09 next collapse

Modern problems require modern solution.

lemming741@lemmy.world on 08 Jan 14:29 next collapse

VPS providers hate this one trick

passiveaggressivesonar@lemmy.world on 08 Jan 14:51 next collapse

I was wondering why they still sold servers with disk drives

plum@lemmy.zip on 08 Jan 19:38 next collapse

I haven’t worked in a data center in years, so I don’t know the current norm for server hardware.

HiddenLayer555@lemmy.ml on 08 Jan 19:52 collapse

For deploying your sick playlist to production, obviously!

passiveaggressivesonar@lemmy.world on 08 Jan 20:45 collapse

No not mine, thermal performance always goes haywire 😔

0x0@programming.dev on 08 Jan 16:26 collapse

Some CD trays will auto-close though.

plum@lemmy.zip on 08 Jan 19:36 collapse

The Dell servers we had at the time all had slim laptop style CD trays, so no auto-close to worry about.

wuphysics87@lemmy.ml on 08 Jan 17:51 next collapse

I need to go put my DVD drive back in my tower to try this!

netvor@lemmy.world on 08 Jan 20:52 next collapse

lemme guess… and inject would close it again?

hellfroze@lemmy.world on 09 Jan 00:30 collapse

eject -t

There’s also eject -T which is a toggle.

JoeBidet@lemmy.ml on 08 Jan 21:46 next collapse

don’t use it if you’re flying a plane, though!

communism@lemmy.ml on 08 Jan 23:11 next collapse

I still have a disk drive but eject doesn’t seem to affect it since for some reason I don’t have a /dev/cdrom. I just checked with the physical eject button on the drive and it is at least still physically working—the tray ejects! I don’t have any optical media to test if the drive still works to read CDs though

crater2150@feddit.org on 09 Jan 01:00 collapse

Try eject /dev/sr0, that should be your disk drive if it is attached via SATA or USB. /dev/cdrom is usually just a symlink.

communism@lemmy.ml on 09 Jan 01:07 collapse

Afraid I don’t have a /dev/sr0. Tbh I built this PC yonks ago, I don’t remember how I plugged in my optical drive. I assume SATA would be the sensible and most likely option.

I’m on Artix Linux with runit if that matters at all?

I mean, it doesn’t matter to me whether or not I can eject my optical drive with a command, but at this point I’m just curious as to where the drive is on the filesystem lol

Edit: I tried loading sr_mod with modprobe sr_mod (which wasn’t loaded for me) but still not seeing any sr* or cdrom in /dev. Again, not too bothered about this, but I’m kinda curious.

zzx@lemmy.world on 09 Jan 03:04 collapse

Connected power but not SATA maybe?

communism@lemmy.ml on 09 Jan 16:46 collapse

Maybe? I remember I have used it to read optical discs before (on Linux too) and I don’t think I’ve unplugged anything

adrianhooves@lemmy.today on 09 Jan 01:37 next collapse

woa what the frick!! that actually scared me it’s like 2001 space odyssey type of stuff

Reddfugee42@lemmy.world on 09 Jan 05:21 next collapse

Those are discs not disks kiddo

ChaoticNeutralCzech@lemmy.ml on 09 Jan 06:09 collapse

I was wondering about OP’s soft-eject floppy drive. Seems quite retrofuturistic.

Reddfugee42@lemmy.world on 10 Jan 10:42 collapse

Macs had them, so they could control when the user was able to have their disk back 😅

captain_aggravated@sh.itjust.works on 09 Jan 06:02 next collapse

tilts head

plugs in USB optical drive

eject

pop

hehe

push tray back in

eject

pop

hehehe

Kynn@jlai.lu on 09 Jan 06:19 next collapse

Sorry, my what ? Are you talking about relics of the past ? ;D

Feathercrown@lemmy.world on 09 Jan 06:20 next collapse

<img alt="" src="https://lemmy.world/pictrs/image/206ee969-e515-4c6b-8c23-e9dbdd67ab02.jpeg">

lord_ryvan@ttrpg.network on 11 Jan 01:24 collapse
shirro@aussie.zone on 09 Jan 09:00 next collapse

There is a whole world of obsolete stuff nobody will ever do with a linux system anymore. Terminal servers with lots of serial terminals or modems for a BBS. Making a fax server, IVR, digital answering machine for analog land lines. Using removable optical or magnetic media. Recording broadcast tv. SCSI, Firewire. It is interesting to imagine what from today will be obsolete in a few years.

TheGingerNut@lemmy.blahaj.zone on 13 Jan 14:00 collapse

Magnetic media is still king of price to capacity (Hard drives) and I literally do still record broadcast television on one of my linux boxes

Sturgist@lemmy.ca on 10 Jan 07:08 next collapse

I just tried and it doesn’t seem to work for me.

Wait…do I need an optical drive for this to work? I think I might have a plug in drive somewhere…

data1701d@startrek.website on 10 Jan 22:09 collapse

I have a Blu-ray drive, though my case doesn’t have 5.25” bays, so I just have the SATA cables come put the side.

The sole reason I have it is because once a couple years back, I wanted to watch the Star Trek: TNG Spanish dub, which was only available in the US on a Bluray, which I promptly borrowed from my local library.

I have used it a couple times after, though - once to burn a CD-R with TinyCore to boot on a Pentium II laptop, and once to backup a Bluray with a dub only available on that medium.