Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
After installing some linux, creating partitions, deleting partitions, the numbers of my partitions are all mixed up.
For exemple: First I have windows (sda1), but the secound partition, that used to be (sda2) now is (sda5). I have other partitions that jump to (sda7)(sda8)(sda9).
So, What I want is to change these numbers to make the secound partition in my hard disk be SDA2 and not SDA5, SDA10 or whatever.
I have a similar problem in my WIndows. I have (c:/), but then I have 2 CDs called (d:/ and e:/), then my other partitions that are used to store only my files are G:/ and H:/. I don't want that! I want all my partition to have a sequence letter and then, the rest can be used to label the CDs and DVDs drivers.
PARTITION MAGIC doesn't solve this problem, before someone says that. It just change the letters of partitions in the hard disk and not letters used by CDs.
sda5 is the number for the first partition inside an extended partition. you can't change 5 to 2 without changing it to fundamentally be a physical partition.
Hi. I don't know If I can understand what you said. Can I change it to 2 if I change it to be a physical partition? I don't really think I understand the differences between extended and physical partitions. Can you explain it?
My partitions are mixed up like this:
1 partition: Windows sda1 20 GB
2 partition: Suse sda9 (used to be sda6 - reinstallation) 10 GB
3 partition: Fedora sda7 5 GB
= FREE SPACE NOT USED about 80 GB I think
4 partition: NTFS extended sda8 40 GB
5 partition: NTFS extended sda5 40 GB
6 partition: SWAP sda9 600 MB
physical and exetended partitions take up the numbers 1 to 4. there is an arbitrary fudge (which i'd bet money is M$'s fault...) which meant a hard drive can only contain 4 partitions. the extended partition type was eventually concieved meaning additional logical partitions could be used inside one of the real partitions. so those first for are the real partitions, everythign higher is logical. so if you changed a partition from logical to physical, somethign i know nothing about actually doing, then it would instantly become sda3 or something. you have an additional partition not listed there of course, the extended partition(s) itself, which if you do an fdisk -l you'll probably see as sda2.
I see. I think I might know a way to change some partition from logical to physical. I've never heard about this limited number of partition.
About why I care about the number is simple. It's easier to mount a partition if their numbers follow the position they take in the hard disk. Why would I worry myself about it if I can auto mount it through /etc/fstab? The answer is: My 2 storage partitions of 40 GB each are NTFS partition, so many problems occur if I mount it during the boot, and even If I don't get problems with that I have other problems with programs, permissions, etc that aren't well fixed through fstab. You might say you don't have this kind of problem, but I bet you don't write in you ntfs partition.
I'm using captive to mount the partitions and I get some computer crushes mounting ntfs partitions during boot time, so I need to mount these partitions everytime I boot my computer.
Fix the letters in a sequence would help me a lot.
You could back up your system, then redo the drive by erasing all the partitions and repartitioning them like you want then restoring your system. After all, doing a back-up is a good idea anyway. I don't know of any way to do what you want to without starting over from scratch. This is how I did mine:
You can fix partitioning order with fdisk in expert mode. However, this may break things for you, at least fstab has to be corrected. Your logical partitions still will start from 5 of course.
I think what you're missing here is an essential difference between Linux (*nix) & "Winders" -- W/ M$, drive letters are arbitrary & variable, depending on what is mounted. In GNU/Linux, the partition designators almost perfectly match hardware reality & don't change (unless you mess w/ th BIOS).
When coming over from M$ & drive letters, it is confusing & sometimes annoying -- "C:" is 2 characters, "/dev/hda1" is 9! However, because of the fixed & therefore reliable nature of the system, I find that now that I have gotten used to it, I scoff at Gates & Co. & wouldn't go back.
As noted above, you can't change the "hdxn" of a partition w/o changing its position on the HD. I doubt that that is what you really want to do. I think this is 1 of those cases where we need to look at your underlying problem, not the perceived problem in implementing an inappropriate fix.
Some notes:
It's "primary" & "logical", not "physical" & "logical" -- every partition is as "physical" as every other.
In GNU/Linux, partitions ARE labelled in way that perfectly corresponds to their order on the drive. Let me repeat for emphasis:
In GNU/Linux, partitions ARE labelled in way that perfectly corresponds to their order on the drive.
If you somehow manage to change your partitioning arrangement, which really won't be all that easy, then you will need to change your /etc/fstab as Emerson has already said. You will also need to change grub's menu.lst. And then you will need to rebuild your initrd if your distro uses this to boot. And as has been said, backups are a mandatory step in the process.
Make sure you have a Knoppix of other LiveCD handy to boot with to fix things. Chances of getting it all correct and workable on the first try are, well, ... just make sure you have a Knoppix CD handy!
I see I wasn't narrative enough. Yes, partitions can be out of order after deleting some and moving/resizing others. My second SCSI is out of order right now sdb1-sdb3-sdb2. Fixing it would be quite easy fdisk /dev/sdb,
then press x followed by f.
You know, I really really really thought that you could NOT have primary partitions following logical partitions on a disk (physical order on the disk). But acid_kewpie, whom I greatly respect, says differently here. And the fdisk output in the first post in the following thread also seems to prove me wrong: http://www.linuxquestions.org/questi...d.php?t=432562
Quote:
that's my day ruined
...and you think YOUR day is ruined! I was just proven wrong in something I really really really thought I knew. I'm crushed! It's amazing how your brain can latch onto a factoid, even if totally false, and then continue to treat that as gospel truth. Damn partitions. I thought I knew this stuff!
You could back up your system, then redo the drive by erasing all the partitions
That's not a viable for me and it also isn't what I'm interested to learn. I want to know if and how I can change the partition number.
Quote:
I think what you're missing here is an essential difference between Linux (*nix) & "Winders" -- W/ M$, drive letters are arbitrary & variable, depending on what is mounted. In GNU/Linux, the partition designators almost perfectly match hardware reality & don't change (unless you mess w/ th BIOS).
Hi. Just to let it clear, I didn't say that my problem with Linux was the same problem I was having at windows. I said: I have a similar problem in Windows and that problem is BLA BLA BLA (new problem). I fixed that anyway.
Another thing, I don't agree with you that partition designators almost match hardware reality. They will only match it if you create the partitions in sequence from the first cluster to the following one. If you create a partition at the beginning of your hard disk, then one at the end and then one in the middle of it, they aren't goint to be correctly labeled or saying it differently they aren't goint to be sequencely labeled (1,2,3...)
That's why my partition numbers are all wrong and I want to change it. I want the partitions to be numbered in the same sequence they are positioned in my hard disk (easier to remember and mount it).
Quote:
match hardware reality & don't change (unless you mess w/ th BIOS)
I don't think this is true either. Even here a few people have already said that you can chance it and none of the ways were through Bios. As far as know this has nothing to do with the Bios, because if it had something to do with the Bios you would have to write/change your Bios every time you create a partition and that's not what happens as far as I know. To change the Bios you would have to make a kind of Bios Update and with some Bios you can't even do that because the Bios may not be writable, and then if that were true you would never be able to create a partition on this hard disk.
Quote:
you can't change the "hdxn" of a partition w/o changing its position on the HD.
I never mentioned or intended to fix the problem by moving any partition. I just wanted to change their label/number. I thought I was clear about that. I'm sorry.
Quote:
If you somehow manage to change your partitioning arrangement, which really won't be all that easy, then you will need to change your /etc/fstab as Emerson has already said. You will also need to change grub's menu.lst. And then you will need to rebuild your initrd if your distro uses this to boot. And as has been said, backups are a mandatory step in the process.
I really hope that there's a better way to do it for the entire system without going through all these steps.
Thank you all agian.
Hi again. I mentioned in one of my posts that I thought I knew a way to change the partitions from extended to primary. As you guys said It would change the partition from number 5 up, to 4 down. The way to do it is using the boot CD (suse for exemple). By manual partitioning I can edit the partitions and I found there the option to change it from logical to primary. I just don't know If it's gonna work 'coz I've never tried it before.
Anyway, I really prefer to change the numbers as I want it, of course, respecting if the partition is primary or logical. I can't accept that there is no program or command to change it easily. I really hope someone says that's is possible to do.
Have you tried the YAST partitioner? It works just fine for me, mind you I have a number of external USB/Firewire HDDs which I connect, unmount and repartition (using YAST partitioner) being very careful to create start/end block sizes that are exactly the same size as the partitions on my laptop. then it is merely a: '# dd if=/dev/hda5 of=/dev/sdb7 bs=512 conv=notrunc,noerror' and a 10 minute process to copy a 10.5GB partition. If later I want to create/resize another partition on my machine I just use YAST and can 'dd' the recently exported partition back into a new space (partition).
Beware you can destroy data real quick if you don't have backups before you play. However, once the backups are made you can happily resize reiserfs downwards without any loss of data.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.