1

I have a harddrive with 24 logical partitions on it. Half of them are Linux and half are windows. Current ordering is: 3 Linux partitions; 12 windows partitions; 9 Linux partitions. In this setup, Windows can access any of partition (no limits on partition number), but Linux can't access sda16, sda17 ...

Can I change numbering of partitions without moving them on disk? I want to put all Linux partitions to be <16; and windows partitions to be > 16, so linux will be able to access all linux partitions.

I have fdisk/sfdisk and it sees all partitions.

10
  • 2
    I probably don't want to know, but why do you have so many partitions? Nov 14, 2011 at 0:49
  • Files are laid more compact, when kept on different partitions (one partition to develop c++ programs, other with ISOs of Linux, other with Win. software, one with photoes, one for photo editing with heavy disk I/O,...). Also, I have many OSes installed, each with several versions. Also, some partitions were byte-by-byte copied from failed HDDs - and there are some partitions from such actions. I'm not counting partitions from virtual environments.
    – osgx
    Nov 14, 2011 at 0:56
  • But after all, it is just a sad fact, that I have too much partitions to access them from Linux. And I can easily solve this with just relinking a partition tables, so Linux partitions will have smaller numbers.
    – osgx
    Nov 14, 2011 at 0:58
  • apart from the fact that your disc setup is pretty crazy and changing anything will be hell because of the primary/logical setup (chained extended partition tables). im pretty sure you cant change the number the OS assigns. even if the part table contains start, size and end sector, the resulting setup would be to weird an unconventional for any OS to understand :)
    – weberik
    Nov 14, 2011 at 1:00
  • I want reorder chain (linked list) of extended tables (reorder extended partitions), even without touching primary partitions. This is possible, because linux fdisk has an option to "Sort" partition order if it differs from real disk layout (e.g. {ext1 ext3 ext2} will be sorted to {ext1 ext2 ext3} ). In this case I want a reverse operation, unsort".
    – osgx
    Nov 14, 2011 at 1:10

2 Answers 2

2

You can rearrange the partition table using sfdisk, which is very risky (vulnerable to human error) but probably the only way. I described how to do that here - you'll need to adapt the procedure to your specific scenario.

1
  • I think, sfdisk is capable of this action (so does openbsd's fdisk but at lower layer). But my problem was solved via mount -o offset=##### /dev/sda sda20)
    – osgx
    Nov 15, 2011 at 18:51
1

Disclaimer: I haven't tried it, but if you are feeling adventurous, you may try this:

Prepare to compile your own kernel, then go to the sources, edit drivers/scsi/sd.c and look for the line

#define SD_MINORS 16

And increase this number, then recompile the kernel.

Then depending on your distribution, you may need to create device files by hand with mknod. Or your device names may become completely messed up.

Good luck

1
  • b0fh, this is wrong question to post this answer. Here I try to get information how to change order of partitions to keep current kernel. And here superuser.com/questions/357101/… I ask about other way of fixing problem: changing the kernel. As I know, in newer kernels sda16 may become sdb1, but I'm not sure and I don't know, which version of kernel I need.
    – osgx
    Nov 14, 2011 at 1:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .