LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   overlapping partitions? after failed attempt to install PCLOS (http://www.linuxquestions.org/questions/linux-newbie-8/overlapping-partitions-after-failed-attempt-to-install-pclos-878822/)

ubume2 05-04-2011 02:42 PM

overlapping partitions? after failed attempt to install PCLOS
 
Edit: I think the installation caused the corruption of the partition table. I removed the last 3 logical partitions and gparted correctly reported the 2 remaining distros and the swap. The problem hopefully will be solved when I reinstall those distros.

I have a 160 gig HD with 3 Linux,1 swap,and a Windows partition.

I attempted to install PCLINUXOS unsuccessfully.

When I rebooted I had the same grub. I checked gparted and it indicated all 160 gigs as unallocated. fdisk shows the partitions. and indicates one partition as empty where I attempted to install PCLOS.

No problem in accessing any of my distros, but currently I can't make any changes to my HD. I've tried parted magic and there was no solution there. I have been unable to download the Ubuntu Rescue remix.

Is there a way to restore? I haven't used fdisk or cfdisk for that purpose. I would appreciate being referred to a tutorial that would take me through this (hopefully step by step). I am beginning to think I would need to delete all of the partitions in the extended.
FDISK
omitting empty partition (8)

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x23213b72

Device Boot Start End Blocks Id System
/dev/sda1 * 1 5354 43005973+ 7 HPFS/NTFS
/dev/sda2 5355 15690 83022975 5 Extended
/dev/sda3 18740 19059 2560000 82 Linux swap / Solaris
/dev/sda4 19059 19458 3203072 83 Linux
/dev/sda5 5355 7908 20506624 83 Linux
/dev/sda6 7908 10840 23552000 83 Linux
/dev/sda7 10840 13772 23552000 83 Linux

markush 05-05-2011 07:05 AM

http://tldp.org/HOWTO/Partition/

I don't think that you have a partition problem. When you delete logical parititions, the numbers of all following partitions change. This means if you have deleted one partition which was not the "last" on the extended partition, then every following partition will increase it's number by one. Example: you have logical partitions sda5 up to sda10 and now you delete sda7 then formerly sda8 becomes sda7 and formerly sda9 becomes sda8 and so on.

So the solution for your problem is to adapt the /etc/fstab-file on your Linux-system.

Markus

masterclassic 05-05-2011 08:01 AM

Quote:

FDISK
It is often better to use fdisk with the -lu arguments. That manner it will display the partition limits using sectors as unit, not cylinders of 8225280 bytes. Then, it is easier to detect eventual overlapping partitions.

Another point:
Partitions out of the numerical order can sometimes cause problems, at least in the usual MBR hard drive format. Some disk utilities could detect this as problem. Logical partitions are more susceptible to such problems, due to the structure of the extended & logical partitions: there is no partition table as for the primary partitions, pointing to each one. There is just a pointer to the next logical partition. So, it seems safer to make logical partitions in the order, from the beginning to the end of the extended one.

ubume2 05-06-2011 05:29 PM

Quote:

Originally Posted by markush (Post 4347218)
http://tldp.org/HOWTO/Partition/
........
........
So the solution for your problem is to adapt the /etc/fstab-file on your Linux-system.
Markus

Quote:

Originally Posted by masterclassic (Post 4347276)
It is often better to use fdisk with the -lu arguments. That manner it will display the partition limits using sectors as unit, not cylinders of 8225280 bytes. Then, it is easier to detect eventual overlapping partitions.

Another point:
Partitions out of the numerical order can sometimes cause problems, at least in the usual MBR hard drive format. Some disk utilities could detect this as problem. Logical partitions are more susceptible to such problems, due to the structure of the extended & logical partitions: there is no partition table as for the primary partitions, pointing to each one. There is just a pointer to the next logical partition. So, it seems safer to make logical partitions in the order, from the beginning to the end of the extended one.

Looking at my fdisk -l certainly doesn't look like the ideal. They are certainly not in order.

I think the problem is my lack of understanding of fdisk and its functions. Are there extensive tutorials on fdisk step by step for dummies? Also rescue cd's that would be helpful?

I did manage to figure out how to delete partitions with fdisk.

Going to start with that TDLP.org how to partition.

markush 05-06-2011 06:22 PM

The problem is, that if you delete any logical partition, you will automatically change the diskorder.

In your output of fdisk -l from post #1 there is nothing wrong.

I don't know what you want to achieve with the partitions of your disk, maybe you'll describe it in more detail. This would help us to point you in the right direction.

As a live-CD there is porteus http://porteus.org/ which is based on Slackware or grml http://grml.org/ which is based on Debian. Both can be used for partitioning a disk or performing a backup on an external storage-medium.

Markus

ubume2 05-06-2011 09:38 PM

Quote:

Originally Posted by markush (Post 4348795)
I don't know what you want to achieve with the partitions of your disk, maybe you'll describe it in more detail. This would help us to point you in the right direction.
Markus

It's not just partitions, its recovery and repair. I guess suggestions for a source book or detailed tutorial that describes modifying partition tables, working with fstab & fdisk, restoring so called empty partitions.(That one was where PCLOS was supposedly installed. I Have a nearly 1000 page book by Mark Sobell on Linux Commands, etc and nowhere do I see how to work with fdisk.

Example: I just had to replace an Ubuntu partition because it would not let me read/write erase from or write to usb drive. I suspected it was something to do with fstab, mtab or something. With the right knowledge I might have been able to correct the problem. On the other hand it probably would take longer to do all that rather than erase that partition and start over.

But I am only slightly above a newbie, and getting old at that, but I am curious and want to learn. Reading from the man pages is dry and not easy to follow.


As far as the various so called rescue live cd's, they don't seem to do anything more than my Ubuntu Live CD

markush 05-07-2011 04:00 AM

Quote:

Originally Posted by ubume2 (Post 4348868)
...Example: I just had to replace an Ubuntu partition because it would not let me read/write erase from or write to usb drive. I suspected it was something to do with fstab, mtab or something. With the right knowledge I might have been able to correct the problem. On the other hand it probably would take longer to do all that rather than erase that partition and start over...

This question will no book ever answer since the fact that you can't read/write to it has nothing to do with fdisk. Please describe what you tried in order to read write to the disk. Normally if you can't read/write there is one of two reasons, you haven't loaded the appropriate kernelmodule for the filesystem or you forgot to set the correct permission which allow a normal user to write to a drive. If an USB-device is not writeable, maybe you mounted it as root and therefor have no writepermissions as a normal user.

Note that /etc/mtab exists only at runtime and is created and altered by the mount command, it only shows the devices which yet are mounted. the "mount" command (without any arguments) prints this table.

Post the fstab-file and tell us which of the partitions doesn't act as you expected.

Markus

ubume2 05-07-2011 08:03 AM

Markush said "This question will no book ever answer since the fact that you can't read/write to it has nothing to do with fdisk."

Okay. Right there. How did you learn what you told me? The usb drive not deleting files or allow you to place new files happened repeatedly in one ubuntu partition only. I thought fstab or something like that would change it. Evidently, something in the install had become corrupted. After trying to find out why, I gave up, deleted that install, and reinstalled it.

How do I get all that base knowledge?

This is getting way off topic. There are some answers that will never be found. Lots of good answers to problems by just googling it. Can't find that in a book. I can fix 80% of the problems I run into. I guess I ought to be happy with that. The best resource is not a book. The best resource is to "google it". I am going to mark this thread as solved

yancek 05-07-2011 10:06 AM

Quote:

Looking at my fdisk -l certainly doesn't look like the ideal.
No it doesn't. You have your windows partition at the beginning of the disk, no problem. You then have your second primary partition sda2 as an Extended partition with sda5-7 within it. You then have sda3 (swap) and sda4 (linux) primary partitions. Note the numbers in your fdisk output under "Start" and "End" for the Extended - 5355 15690. sda1, your windows partition ends at 5354 and the Extended starts at 5355, the way it should. The end of the Extended is 15690. The start of sda3 is 18740 so the space between 15690 and 18470 is wasted. To use it, you would need to resize your Extended partition. You do have enough room in your current Extended partition to create another. I couldn't really tell specifically what you wanted to do from your posts?

ubume2 05-07-2011 12:37 PM

Quote:

Originally Posted by yancek (Post 4349215)
No it doesn't. You have your windows partition at the beginning of the disk, no problem. You then have your second primary partition sda2 as an Extended partition with sda5-7 within it. You then have sda3 (swap) and sda4 (linux) primary partitions. Note the numbers in your fdisk output under "Start" and "End" for the Extended - 5355 15690. sda1, your windows partition ends at 5354 and the Extended starts at 5355, the way it should. The end of the Extended is 15690. The start of sda3 is 18740 so the space between 15690 and 18470 is wasted. To use it, you would need to resize your Extended partition.

Quote:

Originally Posted by yancek (Post 4349215)
You do have enough room in your current Extended partition to create another. I couldn't really tell specifically what you wanted to do from your posts?

The discussion devolved from a specific problem re the PCLINUX install to realizing my frustration that I couldn't get a tutorial "for complete idiots". Like how to read fdisk -l, how to know when fstab isn't right. I need tutorials, not man pages to explain these things and how to fix them, so I can become more independent. Like I said previously I have a 1000 page manual by Mark G Sobell and nowhere does it explain this stuff. Ubuntu forums have good tutorials. But their documentation on how to rescue, restore are a little technical for me.

I saw one tutorial on a linux forum that said that the partitions should be in order. Gparted has a line in it that partitions are not necessarily in order.
Partition 4 100-150, Partition 5 151-200....etc. It seemed to be saying if fdisk doesn't show that than there is a potential for problems. But apparently, it is not that way as long as the partitions don't overlap. So it is apparent conflicting information that confuses me. The way I see that fdisk read out there are some logical partitions that seem to me to extend far beyond the "extended partition"

I think I have learned a little with this discussion, and you and others have been most helpful. I know it's hard for me to explain things step by step, and organized when I am sending emails or posting to forums. So I apologize for that.

So a good book or an excellent online tutorial that explains this in non-technical english would be my wish

yancek 05-07-2011 03:32 PM

Quoting from your initial post:

Quote:

o problem in accessing any of my distros, but currently I can't make any changes to my HD. I've tried parted magic and there was no solution there
You didn't say what changes you wanted to make.

Quote:

Is there a way to restore?
Restore what?? You don't indicate anything specific. I'm not sure why you deleted the partitions you did or why you think your will need to delete your additional logical partitions??

I installed PCLinuxOS on two machines on logical partitions last week. I've been doing this for awhile but, if you have a specific problem you should mention it. What I usually do is make a not of each step and what I do, sometimes saving it to a text file or just making notes in case something goes wrong. Even if nothing goes wrong, if you do this, it will help you learn for the next install of that or some other operating system.

Quote:

I saw one tutorial on a linux forum that said that the partitions should be in order
They should be but there "should be" justice all over the world and there isn't. If you continue visiting LQ, I'm sure you will see many posts with fdisk output indicating that partitions don't end on cylinder boundary and other errors. Usually, these systems are still working. So it should be but is not always necessary.

Quote:

The way I see that fdisk read out there are some logical partitions that seem to me to extend far beyond the "extended partition"
No, there aren't. Look at them. The ones that go beyond sda2 which is your Extended partition, are sda3 and sda4. In Linux, partitions numbered from 1-4 are primary, logical partitions start at 5.

markush 05-07-2011 03:43 PM

Quote:

Originally Posted by yancek (Post 4349430)
...
I installed PCLinuxOS on two machines on logical partitions last week. I've been doing this for awhile but, if you have a specific problem you should mention it. What I usually do is make a not of each step and what I do, sometimes saving it to a text file or just making notes in case something goes wrong. Even if nothing goes wrong, if you do this, it will help you learn for the next install of that or some other operating system.
...

I agree,

@ubume2: note that the command
Code:

date > fdisk.txt
fdisk -l >> fdisk.txt

will create a file named "fdisk.txt" with date and time in the first line and the ouput of fdisk -l. You should save this file on another disk or (the saver choice) print it out.

The partitiontable is only a table of contents for the disk, there is no direct relationship between the partitiontable and the physical data. So if you by mistake alter the partitiontable, you can go back when you have a printed version of the old partitiontable. You can restore it with fdisk (which requires some experience ;) ).

Markus

ubume2 05-07-2011 04:14 PM

Quote:

Originally Posted by markush (Post 4349437)
I agree,

@ubume2: note that the command
Code:

date > fdisk.txt
fdisk -l >> fdisk.txt

will create a file named "fdisk.txt" with date and time in the first line and the ouput of fdisk -l. You should save this file on another disk or (the saver choice) print it out.

The partitiontable is only a table of contents for the disk, there is no direct relationship between the partitiontable and the physical data. So if you by mistake alter the partitiontable, you can go back when you have a printed version of the old partitiontable. You can restore it with fdisk (which requires some experience ;) ).

Markus

Thanks for the information.

Quote:

Originally Posted by yancek (Post 4349430)
Quoting from your initial post:
You didn't say what changes you wanted to make.
Restore what??

On the fdisk I posted there is a so called empty partition. That partition was the one I attempted to install PCLINUXOS. There was several minutes that I thought it was installing. When I rebooted and reconfigured grub2, PCLOS wasn't there. I think I checked gparted first. It gave the whole HD as unallocated. (Since it showed unallocated I didn't think I could do any more installs or removals on the computer.) I later did the fdisk.

I looked over the history of my posting. A couple of years ago I had the same problem installing PCLOS. I knew even less then. I had an unbootable system and thought my HD had died. I had to reinstall everything.

With this second install of PCLOS I wonder if there isn't something flaky about the install. I got dialog boxes that would appear and disappear with the blink of an eye.

I would like to install PCLOS but am now leery of doing so. I don't want to completely reinstall on the HD again.

I have two LOS CD's, 1 Gnome 1 KDE. I notice LOS uses grub legacy. Is it possible to boot PCLOS from grub2?

Edit: I have just installed PCLOS KDE on a spare laptop. It has two linux installs on it. I figured out from LOS menu.lst how to make it boot from Ubuntu's grub2 menu.

Will try it out and consider installing it in a box with more RAM

RockDoctor 05-07-2011 06:28 PM

Quote:

Originally Posted by ubume2 (Post 4349140)
Okay. Right there. How did you learn what you told me?

I don't know about the parent poster, but the way I've learned what little I do know is by:
1. Reading a book (in my case, Red Hat Linux Bible, but there are a lot of books on that level) and keeping it handy .
2. Using help and man pages
3. Joining a local Linux Users Group (LUG) and asking lots of quesitons
4. Frequenting various forums (including LQ), reading answers to other people's questions, and asking a lot of my own.
5. Trial and Error (including dumb errors, like reformating a whole hard drive instead of a single partition)

masterclassic 05-07-2011 06:38 PM

I would just advice the use of
fdisk -lu
instead of
fdisk -l
to have more precision.

I see that there are adjacent partitions with the same cylinder number. However, there are partitioning utilities that could default to automatically round partition limits to the cylinders. This was the case of GParted, at least in older versions (because at the old m$dos era this was usually suggested for the operating systems of the time). Newer GParted versions offer the choice to round to the cylinder borders, to the MB, or not at all.

I remember cases reported to the GParted forum, where the entire disk was shown erroneously as unallocated. The cause was a partition table corrupted by partitioning utilities: the end sector of a partition was the same as the first sector of the next one. This meant that this sector would belong to both partitions, and 'ovelapping partitions' was reported. However, this was possible to detect by checking partition limits and size in sectors only.

The partition table is well "in order", although not optimised. The only eventual problem can be in the logical partition limits, it is better to check the output of the
fdisk -lu


To restore a deleted partition, you could try "testdisk".


All times are GMT -5. The time now is 12:55 PM.