Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello, when I use fdisk -l I get a list of all disks currently plugged in. These disks are given names such as /dev/sda, /dev/sdb, /dev/sdc, etc... However I noticed that the same disk does not always come with the same name, for example I have an 80GB disk which sometimes comes up as /dev/sdd, and sometimes as /dev/sde,
Is this normal? What determines the name given to a drive?
Also is there a better method than looking at the size of the disk to determine which name corresponds to which physical disk?
yes, most probably it is normal.
The detection process itself will give the names, this reflects to the order of the detection.
You can name your partitions, and you can use partitions by their names or by their uuids. They will not be changed at all.
see /dev/disk
It's kind of determined by which powers up first and gets recognized by the OS. I have an older system with PATA and SATA drives and the /dev/ names flip flop all the time. So use LABELs or UUIDs in your /etc/fstab and bootloader.
I formatted all my disks and deleted all partitions, how can I force the OS to always recognise my Toshiba disk as /dev/sda and my WD disks as /dev/sdb, etc?
Is there an example I can follow?
Quote:
Originally Posted by Shadow_7
Normal == Yes
It's kind of determined by which powers up first and gets recognized by the OS. I have an older system with PATA and SATA drives and the /dev/ names flip flop all the time. So use LABELs or UUIDs in your /etc/fstab and bootloader.
linux /boot/vmlinuz-linux root=UUID=22222222-2222-2222-2222-222222222222 acpi=force acpi_backlight=vendor modeset
Various means to "customize" your UUIDs. tune2fs, xfs_admin, ... Or set it at the point of creation. I tend to use a YYYYMMDD-HH00-PPPP-PPPP-PPPPPPPPPPPP format where YYYY is year, M month, D day, H hour, and P is the partition number. It makes it easier to type if I have to type it manually in grub.cfg or from grubs command line mode "c". Plus a visual reference of how LONG AGO I did this install. Basically replace /dev/AAA# with a UUID=..., as long as the fstab and boot loader know what's up, it just works. Caveat, install grub AFTER you setup /etc/fstab. Or you might find yourself updating grub.cfg a bit too much manually. And re-install grub if you change the UUID.
As far as customizing /dev/ names to device, udev kind of does that. But if you can't boot linux in the first place, you don't get to udev to customize things. So relatively useless for booting names.
I formatted all my disks and deleted all partitions, how can I force the OS to always recognise my Toshiba disk as /dev/sda and my WD disks as /dev/sdb, etc?
Is there an example I can follow?
we were trying to explain, it is not possible, you need to use UUID or labels instead of /dev/sda /dev/sdb ...
But probably there is a way (I don't know about).
Usually sda corresponds to SATA1, sdb corresponds to SATA2 etc.
But it's not gauranteed.
And, it can change just because you happened to have a USB drive connected while booting. It's just not reliable, and can bite you in very bad ways (e.g., booting with your backup drive connected and then writing to the wrong drive because the drive designations were different from usual).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.