this post was submitted on 15 Mar 2024
1017 points (100.0% liked)

linuxmemes

24254 readers
2897 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 users for any reason. This includes using blanket terms, like "every user of thing".
  • Don't get baited into back-and-forth insults. We are not animals.
  • 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.
  • 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, no politics, no trolling or ragebaiting.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, <loves/tolerates/hates> systemd, and wants to interject for a moment. You can stop now.
  • 5. πŸ‡¬πŸ‡§ Language/язык/Sprache
  • This is primarily an English-speaking community. πŸ‡¬πŸ‡§πŸ‡¦πŸ‡ΊπŸ‡ΊπŸ‡Έ
  • Comments written in other languages are allowed.
  • The substance of a post should be comprehensible for people who only speak English.
  • Titles and post bodies written in other languages will be allowed, but only as long as the above rule is observed.
  • 6. (NEW!) Regarding public figuresWe all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations.
  • Keep discussions polite and free of disparagement.
  • We are never in possession of all of the facts. Defamatory comments will not be tolerated.
  • Discussions that get too heated will be locked and offending comments removed.
  • Β 

    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 remove France.

    founded 2 years ago
    MODERATORS
     
    top 50 comments
    sorted by: hot top controversial new old
    [–] [email protected] 171 points 1 year ago* (last edited 1 year ago) (6 children)

    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.

    [–] [email protected] 44 points 1 year ago (2 children)

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

    [–] [email protected] 10 points 1 year ago (1 children)

    Labels are better. IMO; they're semantic.

    load more comments (1 replies)
    [–] [email protected] 8 points 1 year ago (4 children)

    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)
    [–] [email protected] 17 points 1 year ago (3 children)

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

    [–] [email protected] 33 points 1 year ago (2 children)

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

    [–] [email protected] 9 points 1 year ago

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

    load more comments (1 replies)
    [–] [email protected] 29 points 1 year ago (1 children)

    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.

    [–] [email protected] 10 points 1 year ago (3 children)

    I could have RTFM but you guys are more fun.

    load more comments (3 replies)
    [–] [email protected] 8 points 1 year ago (3 children)

    No. Since each partition gets its own UUID, it means it's generated by the OS on creation, no matter the number of partitions. On boot kernel will scan all UUIDs and then mount and map according to them, which is sightly less efficient method than naming block device directly, but far easier for humans and allows you to throw your drives to whichever port you like.

    load more comments (3 replies)
    [–] [email protected] 14 points 1 year ago* (last edited 1 year ago) (2 children)

    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)
    [–] [email protected] 12 points 1 year ago (3 children)

    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?

    [–] [email protected] 7 points 1 year ago* (last edited 1 year ago) (2 children)

    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)
    [–] [email protected] 98 points 1 year ago* (last edited 1 year ago) (5 children)

    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.

    [–] [email protected] 15 points 1 year ago (3 children)

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

    load more comments (3 replies)
    load more comments (3 replies)
    [–] [email protected] 96 points 1 year ago (5 children)

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

    [–] [email protected] 59 points 1 year ago (1 children)

    thats a reason to use the uuid in the fstab

    [–] [email protected] 14 points 1 year ago* (last edited 1 year ago) (9 children)

    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)
    [–] [email protected] 86 points 1 year ago* (last edited 1 year ago) (11 children)

    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.

    [–] [email protected] 36 points 1 year ago (4 children)

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

    [–] [email protected] 26 points 1 year ago* (last edited 1 year ago) (2 children)

    I can't chill ever

    It's a curse

    [–] [email protected] 11 points 1 year ago

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

    load more comments (1 replies)
    [–] [email protected] 14 points 1 year ago (3 children)

    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)
    [–] [email protected] 9 points 1 year 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

    [–] [email protected] 7 points 1 year ago
    [–] [email protected] 7 points 1 year ago (3 children)

    Of course the offended guy links arch wiki article

    load more comments (3 replies)
    load more comments (7 replies)
    [–] [email protected] 57 points 1 year ago* (last edited 1 year ago) (1 children)

    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.

    [–] [email protected] 13 points 1 year ago

    So, EMMC is even worse

    [–] [email protected] 56 points 1 year ago (6 children)
    [–] [email protected] 25 points 1 year ago* (last edited 1 year ago)

    mmcblkxpy
    (SD Card)

    x = device number
    y = partition number

    [–] [email protected] 16 points 1 year ago (1 children)

    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 (1 replies)
    load more comments (4 replies)
    [–] [email protected] 51 points 1 year ago (3 children)

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

    load more comments (3 replies)
    [–] [email protected] 46 points 1 year ago (1 children)
    [–] [email protected] 26 points 1 year ago (2 children)

    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)
    [–] [email protected] 30 points 1 year ago (1 children)

    Different bus, different naming.

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

    [–] [email protected] 9 points 1 year ago (3 children)

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

    load more comments (3 replies)
    [–] [email protected] 29 points 1 year ago (2 children)

    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)
    [–] [email protected] 28 points 1 year 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.

    [–] [email protected] 25 points 1 year ago (3 children)

    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 :(

    [–] [email protected] 11 points 1 year ago

    Raises a glass in Debian 3.0

    load more comments (2 replies)
    [–] [email protected] 25 points 1 year ago

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

    [–] [email protected] 11 points 1 year ago

    /dev/nvme0n1 actually, but sure. Change bad

    [–] [email protected] 8 points 1 year ago (6 children)

    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)
    [–] [email protected] 8 points 1 year ago (5 children)

    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)
    [–] [email protected] 8 points 1 year ago (3 children)

    Shouldn't that be

    hdX, sdX, and nvmewtfisthisp1

    load more comments (3 replies)
    load more comments
    view more: next β€Ί