LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Changing the number of an sd*# partition, is it possible? (https://www.linuxquestions.org/questions/linux-newbie-8/changing-the-number-of-an-sd%2A-partition-is-it-possible-928375/)

Blackened Justice 02-08-2012 04:44 PM

Changing the number of an sd*# partition, is it possible?
 
Hey everyone,

I've recently made some changes in my partioning scheme in order to free up some space to try out another distro. It's now something like this, in an extended partition:

sda5 - swap
sda6 - / - distro 1
sda8 - / - distro 2
sda7 - /home, both distros

Now, the OCD in me is going a bit crazy at the sudden lack of order ;) So is there any way to switch up the numbers of the partitions? Making sda7 into sda8 and vice-versa?

Cheers

Cedrik 02-08-2012 05:28 PM

No, but you have the option to use uuid (/sbin/blkid) as partition identifier if you want

syg00 02-08-2012 05:35 PM

Or even labels - more human friendly.

Blackened Justice 02-08-2012 07:17 PM

So there's actually no way to change the sda number? How can it be so "set to stone"?

syg00 02-08-2012 07:28 PM

Of course it can be changed. You just have to hack the code that assigns the device nodes on boot (easy enough), and any code that follows the chaining for logical partitions. That adds up to a fair bit of code.
Or you delete the partitions and re-allocate in the order you want - how obsessive are you ?.

Cedrik 02-08-2012 07:31 PM

Quote:

Originally Posted by Blackened Justice (Post 4597585)
So there's actually no way to change the sda number? How can it be so "set to stone"?


It's just an index, why pretend the 7th partition is the 8th partition, that would make no sense

Blackened Justice 02-08-2012 07:36 PM

Quote:

Originally Posted by syg00 (Post 4597594)
Of course it can be changed. You just have to hack the code that assigns the device nodes on boot (easy enough), and any code that follows the chaining for logical partitions. That adds up to a fair bit of code.
Or you delete the partitions and re-allocate in the order you want - how obsessive are you ?.

I guess not obsessive enough to move around 500GB of data...

eSelix 02-08-2012 08:14 PM

You can just delete entry in partition table (with logical partions on extended partition in mind) and recreate it with proper order. It is quite dangerous and some useless, how often you access drives by /dev/sda*.


All times are GMT -5. The time now is 11:05 AM.