this post was submitted on 18 Feb 2025
180 points (100.0% liked)

Linux

1266 readers
57 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by AlpΓ‘r-Etele MΓ©der, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

So I'm working on a server from home.

I do a cat /sys/class/net/eth0/operstate and it says unknown despite the interface being obviously up, since I'm SSH'ing into the box.

I try to explicitely set the interface up to force the status to say up with ip link set eth0 up. No joy, still unknown.

Hmm... maybe I should bring it down and back up.

So I do ip link set eth0 down and... I drive 15 miles to work to do the corresponding ip link set eth0 up

50 years using Unix and I'm still doing this... πŸ˜₯

top 50 comments
sorted by: hot top controversial new old
[–] moonpiedumplings@programming.dev 10 points 23 hours ago (1 children)

Use cockpit by Red Hat. It gives you a GUI to make networking changes*, and will check if the connection still works before making the change. If the connection doesn't work (like the ip addresses changed), it will undo the change and then warn you. You can then either force the change through or leave it be.

*via NetworkManager only.

[–] caseyweederman@lemmy.ca 2 points 21 hours ago (1 children)

That's probably because of netplan, right? You should be able to get the same results with just netplan try.

[–] moonpiedumplings@programming.dev 3 points 21 hours ago* (last edited 21 hours ago) (1 children)

Netplan is an abstraction layer, so it can go over systemd-networkd, NetworkManager, or iproute. I suppose it's better though, because it can be used with multiple backends.

[–] caseyweederman@lemmy.ca 1 points 21 hours ago (1 children)

Right, but the entirety of Cockpit is not necessarily required.

[–] moonpiedumplings@programming.dev 3 points 20 hours ago* (last edited 20 hours ago) (1 children)

You don't need to install cockpit on the server being configured, you can use it as a gui to connect from other machines via the flatpak, over ssh.

[–] caseyweederman@lemmy.ca 1 points 19 hours ago (1 children)

Right.
My point is that a wrench was needed and a batmobile was recommended.

[–] moonpiedumplings@programming.dev 2 points 18 hours ago* (last edited 18 hours ago)

No. Netplan uses it's own yaml format, which people would have to learn and use. I don't want to do that, I would rather just configure my existing networkmanager setup, rather than learning another abstraction layer over what is already an abstraction layer.

I understand that cockpit (and similar type tools) are "the whole kitchen sink" of utilities, and it may seem like they come with more than you may need. But that doesn't change the fact that they get the job done, and in some usecases, are better than dedicated tools.

[–] iriyan@lemmy.ml 6 points 22 hours ago* (last edited 22 hours ago)

I still prefer net-tools and use ifconfig eth0 up That ip mess I'd rather do without, and those funky UU device/interface names I wish them out of my system

By the way, what system/init/svc manager are you using? With 50y in your back, cron job to check if it is up and resetting it while you are away. You can always remotely cancel the cronjob ... but it will be a new mistake not the old one :)

I started on Irix and ultrix if you remember those, what would I know :)

[–] fmstrat@lemmy.nowsci.com 2 points 18 hours ago

This is why IPMI is so important.

[–] dependencyinjection@discuss.tchncs.de 3 points 1 day ago* (last edited 22 hours ago)

Not SysAdmin but about a year into my first software engineer job I was working on the live DB in SQL without using BEGIN TRAN ROLLBACK TRAN.

Suffice to say I broke the whole system my making an UPDATE without a WHERE clause. Luckily we have regular backups but it was a lot of debugging with the boss before I realised it was me that caused the issue the client was reporting.

[–] MangoCats@feddit.it 7 points 1 day ago (1 children)
[–] MangoCats@feddit.it 1 points 1 day ago

For clarity, I have done it myself - plenty, but not just on Unix boxes.

[–] apt_install_coffee@lemmy.ml 7 points 1 day ago (2 children)

A few months ago I accidentally dd'd ~3GiB to the beginning of one of the drives in a 4 drive array... That was fun to rebuild.

Like 3 weeks ago on my (testing) server I accidentally DD'd a Linux ISO to the first drive in my storage array (I had some kind of jank manual "LVM" bullshit I set up with odd mountpoints to act as a NAS, do not recommend), no Timeshift, no Btrfs snapshot. It gave me the kick in the pants I needed to stop trying to use a macbook air with 6 external hard drives as a server though. Also gave me the kick in the pants I needed to stop using volatile naming conventions in my fstab.

[–] wewbull@feddit.uk 5 points 1 day ago (2 children)

Your 4 drive raid5 array, right?

Right?!

[–] apt_install_coffee@lemmy.ml 1 points 11 hours ago

I wish.

It was a bcachefs array with data replicas being a mix of 1,2 & 4 depending on what was most important, but thankfully I had the foresight to set metadata to be mirrored for all 4 drives.

I didn't get the good fortune of only having to do a resilver, but all I really had to do was fsck to remove references to non-existent nodes until the system would mount read-only, then back it up and rebuild it.

NixOS did save my bacon re: being able to get back to work on the same system by morning.

[–] Cyber@feddit.uk 1 points 1 day ago

not RAID10 I hope...

[–] twinnie@feddit.uk 66 points 1 day ago (1 children)

I knew a guy who did this and had to fly to Germany to fix it because he didn’t want to admit what he’d done.

[–] Ephera@lemmy.ml 9 points 1 day ago

At $DAYJOB, we're currently setting up basically a way to bridge an interface over the internet, so it transports everything that enters on an interface across the aether. Well, and you already guessed it, I accidentally configured it for eth0 and couldn't SSH in anymore.

Where it becomes fun, is that I actually was at work. I was setting it up on two raspis, which were connected to a router, everything placed right next to me. So, I figured, I'd just hook up another Ethernet cable, pick out the IP from the router's management interface and SSH in that way.
Except I couldn't reach the management interface anymore. Nothing in that network would respond.

Eventually, I saw that the router's activity lights were blinking like Christmas decoration. I'm guessing, I had built a loop and therefore something akin to a broadcast storm was overloading the router. Thankfully, the solution was then relatively straightforward, in that I had to unplug one of the raspis, SSH in via the second port, nuke our configuration and then repeat for the other raspi.

[–] terminhell@lemmy.dbzer0.com 19 points 1 day ago (1 children)

I formated an OS drive by mistake last night, thought it was my flash drive...

[–] vfsh@lemmy.blahaj.zone 12 points 1 day ago (1 children)

Almost did the same last night on a device that has its internal drive (flash) mounted as mmc and the USB drive was sda

That entire scenario scares me lol

[–] Float@startrek.website 19 points 1 day ago

Every network engineer must lock themselves out of a node at some point, it is a rite of passage.

[–] despotic_machine@lemmy.dbzer0.com 23 points 2 days ago (2 children)

Why don't you use chained commands, or better yet simply create an alias that chains down/up, then use the alias instead?

[–] ExtremeDullard@lemmy.sdf.org 59 points 2 days ago (13 children)

Because I plain forgot I was remote. It's as simple and as stupid as that.

[–] IsoKiero@sopuli.xyz 13 points 1 day ago

We've all been there. If you do this stuff for a living, you've done that way more than once.

[–] melroy@kbin.melroy.org 8 points 1 day ago

That is why you have KVMs..

Fair enough. I've done worse in my time as a keyboard jockey.

load more comments (10 replies)
[–] catloaf@lemm.ee 5 points 2 days ago (2 children)

Or use some kind of molly guard. Or have an OOB management channel.

You'd think you'd learn from your mistakes after one or two of them, not fifty years' worth...

[–] ExtremeDullard@lemmy.sdf.org 14 points 2 days ago

In my defense, I just installed the machine. I was configuring it from home after hours.

[–] IsoKiero@sopuli.xyz 8 points 1 day ago (1 children)

You’d think you’d learn from your mistakes

Yes, that what you'd think. And then you'll sit with a blank terminal once again when you did some trivial mistake yet again.

A friend of mine developed a habit (working on a decent sized ISP 20+ years ago) to set up a scheduled reboot for everything in 30 minutes no matter what you're going to do. The hardware back then (I think it was mostly cisco) had a 'running conrfig' and 'stored config' which were two separate instances. Log in, set up scheduled reboot, do whatever you're planning to do and if you mess up and lock yourself out the system will restore to previous config in a while and then you can avoid the previous mistake. Rinse and repeat.

And, personally, I think that's the one of the best ways to differentiate actual professionals from 'move fast and break things' group. Once you've locked yourself out of the system literally half way across the globe too many times you'll eventually learn to think about the next step and failovers. I'm not that much of a network guy, but I have shot myself in the foot enough that whenever there's dd, mkfs or something similar on the root shell I automatically pause for a second to confirm the command before hitting enter.

And while you gain experience you also know how to avoid the pitfalls, the more important part (at least for myself) is to think ahead. The constant mindset of thinking about processes, connectivity, what you can actually do if you fuck up and so on becomes a part of your workflow. Accidents will happen, no matter how much experience you have. The really good admins just know that something will go wrong at some point in the process and build stuff to guarantee that when you fuck things up you still have availability to fix it instead of calling someone 6 timezones away in the middle of the night to clean up your mess.

[–] Cyber@feddit.uk 2 points 23 hours ago

Without repeating my other comment. This approach saved my life many times

[–] MXX53@programming.dev 9 points 1 day ago

Good to know that in another 30 years, I will still be doing the dumb shit I've been doing for the last 20.

[–] plumbercraic@lemmy.sdf.org 10 points 1 day ago (1 children)

Did this once on a router in a datacenter that was a flight away. Have remembered to set the reboot in future command since. As I typed the fatal command I remember part of my brain screaming not to hit enter as my finger approached the keyboard. πŸ€¦β€β™‚οΈ

[–] ExtremeDullard@lemmy.sdf.org 5 points 1 day ago (1 children)

Have remembered to set the reboot in future command since

That's not a bad idea actually. I'll have to reuse that one. Thanks!

[–] Cyber@feddit.uk 2 points 1 day ago

This.

Do it. This saved my life on more than one occasion.

You'll think β€œnah, it'll be fine” and then at 11pm when your brain's fried on vending machine coffee you'll be glad that you did it.. 3 times over...

[–] Tippon@lemmy.dbzer0.com 9 points 1 day ago (1 children)

If it makes you feel any better, I did something just as infuriating a few years ago.

I had set up my home media server, and had finally moved it to my garage with just a power cable and ethernet cable plugged in. Everything was working perfectly, but I needed to check something with the network settings. Being quite new to Linux, I used a remote desktop tool to log in and do everything through a gui.

I accidentally clicked the wrong item in the menu and disconnected the network. I only had a spare ps/2 keyboard and mouse, and as the server was an old computer, it would crash if I plugged a ps/2 device in while it was running*.

The remote desktop stayed open but frozen, mocking me for my obvious mistake and lack of planning, with the remote mouse icon stuck in place on the disconnect menu.

*I can't remember if that was a ps/2 thing, or something specific to my server, but I didn't want to risk it

[–] bobs_monkey@lemm.ee 9 points 1 day ago

Old hardware used to get really upset before plug and play became common. I remember I was playing some old racing game with a joystick on a win95 box, and accidentally pulled the connector out, lost my entire game because the system flipped out.

[–] thingsiplay 7 points 2 days ago

Remember what Bruce Lee said:

I fear not the man who has practiced 10,000 kicks once, but I fear the man who has practiced one kick 10,000 times.

There, but for the grace of god....

load more comments
view more: next β€Ί