1000
top 50 comments
sorted by: hot top controversial new old
[-] dan@upvote.au 175 points 9 months ago* (last edited 9 months ago)

and you shouldn't be using any of those, since the order can and will change. The numbers are based on the order the devices and device drivers are initialized in, not based on physical location in the system. The modern approach (assuming you're using udev) is to use the symlinks in /dev/disk/by-id/ or /dev/disk/by-uuid/ instead, since both are consistent across reboots (and by-id should be consistent across reinstalls, assuming the same partitioning scheme on the same physical drives)

This is also why Ethernet devices now have names like enp0s3 - the numbers are based on physical location on the bus. The old eth0, eth1, etc. could swap positions between Linux upgrades (or even between reboots) since they were also just the order the drivers were initialized in.

[-] toynbee@lemmy.world 45 points 9 months ago

I'm sure you know this, but to to supplement your comment for future readers, UUIDs are also a good solution for partitions.

[-] sxan@midwest.social 10 points 9 months ago

Labels are better. IMO; they're semantic.

load more comments (1 replies)
[-] lemmyvore@feddit.nl 8 points 9 months ago

I think OP's point was that UUIDs can still change, but the stuff that makes up the /by-id/ names cannot. Granted, those aren't applicable to partitions.

load more comments (4 replies)
[-] PsychedSy@sh.itjust.works 17 points 9 months ago

Are UUIDs built into the hardware, or something your computer decides on based on the drive's serial number and shit?

[-] taaz@biglemmowski.win 33 points 9 months ago

Uuids are part of the gpt (table) on the disk.

[-] Supermariofan67@programming.dev 10 points 9 months ago

You're thinking of partuuid, regular uuids are part of the filesystem and made at mkfs time

load more comments (1 replies)
[-] lea@feddit.de 29 points 9 months ago

According to Arch Wiki they get generated and stored in the partition when it is formatted. So kinda like labels but automated and with (virtually) no collision risk.

[-] PsychedSy@sh.itjust.works 10 points 9 months ago

I could have RTFM but you guys are more fun.

load more comments (3 replies)
load more comments (4 replies)
[-] JasonDJ@lemmy.zip 15 points 9 months ago* (last edited 9 months ago)

Back in my day, /dev/hda was the primary master, hdb was the primary slave, hdc was the secondary master and hdd was the secondary slave.

Nothing ever changed between reboots. Primary/secondary depended on which port the ribbon cable connected to on the motherboard, and ~~primary/secondary~~ master/slave was configured by a jumper on the drive itself.

load more comments (2 replies)
[-] jadedwench@lemmy.world 11 points 9 months ago

I have a hatred for the enp id thing as it isn't any better for me. It changes on me every time I add/remove a hard drive or enable/disable the WiFi card in the BIOS. For someone who is building up a server and making changes to it, this becomes a real pain. What happens if a drive dies? Do I have to change the network config yet again over this?

[-] Laser@feddit.de 7 points 9 months ago* (last edited 9 months ago)

How is that happening? The number on the bus shouldn't change from adding or removing drives. I could imagine this with disabling a card in UEFI / BIOS if that basically stops reporting the bus entry completely. But drives?

Anyhow, if I'm not mistaken, you can assign a fixed name based on the reported MAC.

load more comments (2 replies)
load more comments (2 replies)
load more comments (2 replies)
[-] DumbAceDragon@sh.itjust.works 101 points 9 months ago* (last edited 9 months ago)

Well it's sdx because they both use the SATA interface. The sdx convention actually comes from scsi though, and the fact that SATA and USB drives use it might point to some code reuse, or maybe a temporary solution that never got fixed due to breaking backwards compatibility.

Fun fact: IDE drives use the hdx naming convention.

[-] Bishma@discuss.tchncs.de 48 points 9 months ago

I still muscle-memory type /dev/hd[TAB] once in a while when looking for storage devices.

[-] stoy@lemmy.zip 15 points 9 months ago

I thought they standardized on sd* even for IDE drive a few years back...

load more comments (3 replies)
[-] 0x4E4F@lemmy.dbzer0.com 6 points 9 months ago

Yeah, but I think they switched to also use sdx for IDE devices as well.

load more comments (2 replies)
[-] redditReallySucks@lemmy.dbzer0.com 97 points 9 months ago

A yes, my beloved nvme1p2 partition that changes name every reboot

[-] ordellrb@lemmy.world 59 points 9 months ago

thats a reason to use the uuid in the fstab

[-] whoisearth@lemmy.ca 11 points 9 months ago* (last edited 9 months ago)

Anyone else chuckle on the parallel in saying to use the UUID is no different than saying "just hardcore the IP bro"

I'm not hating on you, but it's an extremely flawed system where you are forced to use a direct ID mapping as a reference.

From what I'm understanding from people you can assign an alias to the UUID that sounds better?

load more comments (9 replies)
load more comments (4 replies)
[-] vampire@lemmy.world 82 points 9 months ago* (last edited 9 months ago)

https://wiki.archlinux.org/title/Solid_state_drive/NVMe

Namespaces are the construct in NVMe technology that hold user data. An NVMe controller can have multiple namespaces attached to it. Most NVMe SSDs today just use a single namespace, but multi-tenant applications, virtualization and security have use cases for multiple namespaces.

  device v
/dev/nvme0n1p1 < partition
namespace  ^

There are two types of people: Those who are able to identify gaps in their knowledge and actively seek to fill them... and whatever this meme is.

[-] 0x4E4F@lemmy.dbzer0.com 35 points 9 months ago

Dude, chill, it's a funny take on naming conventions.

[-] vampire@lemmy.world 25 points 9 months ago* (last edited 9 months ago)

I can't chill ever

It's a curse

[-] wkk@lemmy.world 10 points 9 months ago

It's like you're sucking the fun out of us... Wait a minute

load more comments (1 replies)
[-] Heavybell@lemmy.world 15 points 9 months ago

We can enjoy the meme and also use it as a learning opportunity :)

I for one didn't know about NVMe namespaces.

load more comments (3 replies)
load more comments (2 replies)
[-] mrbaby@lemmy.world 10 points 9 months ago

Oh god damn it I came here to look at memes and now I friggin learned something that's going to make my life easier

[-] Thcdenton@lemmy.world 7 points 9 months ago
[-] 342345@feddit.de 7 points 9 months ago

Interesting. I learned something. Again.

load more comments (10 replies)
[-] independantiste@sh.itjust.works 57 points 9 months ago
[-] user224@lemmy.sdf.org 27 points 9 months ago* (last edited 9 months ago)

mmcblkxpy
(SD Card)

x = device number
y = partition number

[-] Oisteink@lemmy.world 16 points 9 months ago

NVMe device names follow this pattern: nvme n , where: is an integer that is assigned by Linux during the boot process. The first NVMe device that is detected is assigned 0

load more comments (2 replies)
load more comments (4 replies)
[-] MonkderZweite@feddit.ch 57 points 9 months ago* (last edited 9 months ago)

https://superuser.com/questions/1449499/why-does-linux-list-nvme-drives-as-dev-nvme0-instead-of-dev-sda#1449520

In short; sd stands for SCSI Disk and SSD and USB all use the SCSI protocol. While SD-cards/emmc (flash-on-CPU) are named emmcblkpX for emmc block device, partition X. And NVME have additionally namespaces, which is the nX part.

[-] Pantherina@feddit.de 11 points 9 months ago

So, EMMC is even worse

[-] hperrin@lemmy.world 51 points 9 months ago

It’s called that because it’s Never the Value you Might Expect.

load more comments (3 replies)
[-] arran4@aussie.zone 46 points 9 months ago
[-] Supermariofan67@programming.dev 26 points 9 months ago

That one hasn't been around for a long time, since the Linux kernel started using a SCSI abstraction layer above many of the other storage protocols. Really cool stuff: https://upload.wikimedia.org/wikipedia/commons/thumb/f/fb/The_Linux_Storage_Stack_Diagram.svg/1161px-The_Linux_Storage_Stack_Diagram.svg.png

load more comments (2 replies)
[-] Malix@sopuli.xyz 30 points 9 months ago

Different bus, different naming.

Now, memory kinda hazy, but weren't ide devices /dev/hdX?

[-] 0x4E4F@lemmy.dbzer0.com 9 points 9 months ago

Yeah, they used to be, but they switched a few years back to consistently call all block devices sdx.

load more comments (3 replies)
[-] Kusimulkku@lemm.ee 28 points 9 months ago

I'm guessing it's for some shit to make sure some ridiculous setup with two gazillion drives doesn't have conflicts

load more comments (2 replies)
[-] Anarch157a@lemmy.world 28 points 9 months ago

No one mentioned the Solaris convention yet ?

/dev/cXtXdXsX

The letters mean controller, SCSI target, disk and slice (Solaris equivalent to a partition).

I always thought this was the most elegant naming scheme in the Unix world.

[-] luna@lemmy.catgirl.biz 25 points 9 months ago

Back in the olden times the Linux kernel had a dedicated parallel-ATA subsystem with /dev/hda devices. It was then rolled up in to the scsi subsystem to simplify maintaining drivers (everything using the same library for disk access). I'm old :(

[-] Tja@programming.dev 11 points 9 months ago

Raises a glass in Debian 3.0

load more comments (2 replies)
[-] mrbaby@lemmy.world 25 points 9 months ago

Mine is easy - /dev/nvme[tab][tab][tab]

[-] sleepmode@lemmy.world 9 points 9 months ago

Kinda miss the Wild West days where you'd recompile and suddenly there'd be a whole new device naming convention.

load more comments (5 replies)
[-] waigl@lemmy.world 9 points 9 months ago

It's a lot better than the system that just randomly throws in your USB drives with your SCSI/SAS/SATA/PATA drives. Or the systems that calls everything a SCSI drive when it usually isn't a SCSI drive.

load more comments (6 replies)
[-] phx@lemmy.ca 8 points 9 months ago

Shouldn't that be

hdX, sdX, and nvmewtfisthisp1

load more comments (3 replies)
[-] Matriks404@lemmy.world 7 points 9 months ago

You mean Linux? Other Unixes don't necessarily use this naming convention.

load more comments (2 replies)
load more comments
view more: next ›
this post was submitted on 15 Mar 2024
1000 points (97.1% liked)

linuxmemes

21615 readers
1121 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack members of the community for any reason.
  • Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
  • These rules are somewhat loosened when the subject is a public figure. Still, do not attack their person or incite harrassment.
  • 3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn. Even if you watch it on a Linux machine.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, and wants to interject for a moment. You can stop now.
  •  

    Please report posts and comments that break these rules!


    Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't fork-bomb your computer.

    founded 2 years ago
    MODERATORS