Manually changing sda(x) order from left to right.
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
Manually changing sda(x) order from left to right.
I recently found myself needing some more partitions, and have decided to create a second extended partition from my third primary partition, I just wanted to know, because I believe I've done something like this before and it went wrong;
When I repartition my hard drive, I would like them to be numbered from left to right, but I believe last time I tried it numbered them from latest to newest.
So...
If my setup is like this
sda1 sda2 sda3 (sda4(sda5 sda6 sda7 sda8))
And I turn sda3 into an extended partition, can I force it to end up like this:
sda1 sda2 (sda3(sda4 sda5)) (sda6(sda7 sda8 sda9 sda10))
as opposed to this
sda1 sda2 (sda4(sda9 sda10)) (sda4(sda5 sda6 sda7 sda8))
What would be the best tool for the job? Because I believe gparted left me with the later format, which really confused me for awhile.
Still in the world of theory but if you boot of a live CD, wipe the disk clean of partitions and then recreate them exactly the same size, it should work and you should not lose data.
But why bother? You will have to change you fstab and probably other things might be affected by the change for nothing really.
Romanus;
In terms of the visible extended partition, you can only have one. The extended partition is really the beginning of a linked list which starts in the MBR and then continues thru the first sector of each logical partition, with each logical partition pointing to the next. (If you dig into the details, you'll find that this linked list includes additional "extended partition" entries in the partition table within each successive logical partition. These, however, are not visible to the typical tools.)
Partitions are numbered according to the position in the main (MBR) partition table and then according to the position in the linked list. This normally matches the order of creation, but the numbering will be the same regardless of how they were created.
The entries in the main (MBR) partition table are numbered 1-4, and the logical partitions start at 5 (regardless of the number of entries in the MBR table).
Finally, to first order, the partitions can point to areas of the disk that are neither in order, nor contiguous. Also, the size of the extended partition is useful only to partitioning tools---there is no actual disk area involved.
As pixellany said, you can only have one extended partition. And the logical drives inside it will start from 5 to whatever (to a max of 63, though I think scsi disks have a much lower limit around 15 or so).
There's really no point in playing around with partition just to change how they are labeled. Too much risk for no real benefit. But next time you can just create an extended partition (sda1) and then create logical drives inside it. At least that way you will have three less things to worry about when you need to modify something.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.