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.
I am a new comer to the Linux word. Therefor, please bear with me.
The device labeling (especially the HDs) confuses me all the time in linux. For example:
If I have two HDs, let's say (HDA and HDB), if they are mapped as:
HDA--> sda and HDB---> sdb for specific configuration. In case I go and change their SATA connectors' location on the main board (I basically plug out HDA and plug into a different slot and same with HDB), would that effect their labeling? Basically, might HDA become sdc and let's say HDB might become sda?
How does the linux in general decide to label those HDs?
That is exactly what would happen. The OS detects your devices in a certain order in terms of the actual SATA channels; thus if you swop your drives between the 2 SATA channels - the OS will detect the channels in the same order (and not the drives).
In other words; if you have HDA/sda connected to SATA Channel 1 and HDB/sdb connected to SATA Channel 2; and then you swop the drives around physically; HDB will become sda and HDA will become sdb on an OS level.
That means as long as I don't touch the physical location of a HD, then the labeling should remain the same?
My concern is that I try to setup RAID array and if I replace a bad HD with a new one (which is empty of course) and start rsync the HDs, then the empty one could accidently overwrite the good one, such that I would end up with two empty HDs . What you are saying that's not possible, because as long as I use the same slot, the numbering will be the same.
On the other hand, I tried to give fix and reasonable names via writing udev rules. Are you familar with udev?
Yes the device identifier (sda/sdb) should stay the same. I am familiar with udev (not an expert) but I don't think you need to do this in your situation. If you had to lose one drive; the other drive would retain its device identifier allocation; based on the fact that its still on the same SATA channel.
1) I had 2 HDs connected on the MB, one small and one big HD. The small one was labeled as /dev/sda1 and the big one was labeled as /dev/sdb3, /dev/sdb2 and /dev/sdb1.
2) I removed the small HD from the MB by disconnecting its SATA connector from the back of the HD.
3) I rebooted the system and I get the following: /dev/sda3, /dev/sda2 and /dev/sda1.
I thought in the step 3) everything should remain as /dev/sdb*, since I didn't change the SATA location for that HD.
I need to leave the office right now. I will update you, once I came back on Monday.
But as summary, as long as I keep the numbers of the HDs constant and I don't change the location of the good HDs and replace a bad HD, then I shouldn't get any problem with a labeling in a RAID array?
Correct, as long as the number of drives is maintained, you should have no problems.
I'd hope (but I've never used one) that raid software would be able to identify which HDD has been removed and so can respond to you appropately - "Warning this HDD is empty" kind of thing.
If everybody is on the same page , I swapped both HDs and the system didn't boot. Does it mean that the system couldn't find the boot section/program? In that case hardware should be able to scan the boot section/program in an order? Now this is more confusing!
Once I had both HDs I could boot, even the big HD contained the OS and it was mapped as sdb*. Once the big HD was connected standalone then it was moved down to sda, which we could explain and still we could boot.
After I swapped the HDs, then I would think that the hardware should scan all the HDs and would find out a boot able sector/program, but obviously it couldn't. Now, what is the mechanism?
If everybody is on the same page , I swapped both HDs and the system didn't boot. Does it mean that the system couldn't find the boot section/program? In that case hardware should be able to scan the boot section/program in an order? Now this is more confusing!
Once I had both HDs I could boot, even the big HD contained the OS and it was mapped as sdb*. Once the big HD was connected standalone then it was moved down to sda, which we could explain and still we could boot.
After I swapped the HDs, then I would think that the hardware should scan all the HDs and would find out a boot able sector/program, but obviously it couldn't. Now, what is the mechanism to select/map the HD and boot?
A failsafe solution would involve putting your bootloader on the MBR of all the drives and using UUIDs to identify partitions. Then you could install your drives in any order and it would still work.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.