0

After some partition table problems I finally ran up my Ubuntu and GParted to see my partitions. Then some window appeared.

It sounds really bad...

I clicked Cancel and then second one appeared.

...

I clicked Cancel once again - finally GParted started.

This is how it looks now...

I don't know what to do! GParted says this about my swap:

It sounds bad... At least for me.

/dev/sda4 is my extended partition - this is were my Ubuntu is. Here you can read about my previous problems with partition table. I simply rewrited old partition table - It's not my fault! (I hope)

Also, here's my fdisk -l output:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa118d672

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848   286719999   143256576    7  HPFS/NTFS/exFAT
/dev/sda3       286720000   811972349   262626175    7  HPFS/NTFS/exFAT
/dev/sda4       915726335   976771071    30522368+   f  W95 Ext'd (LBA)
/dev/sda5       915726336   968652799    26463232   83  Linux
/dev/sda6       968652801   976771071     4059135+  82  Linux swap / Solaris

And here's how was it before:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa118d672

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848   286719999   143256576    7  HPFS/NTFS/exFAT
/dev/sda3       286720000   811972349   262626175    7  HPFS/NTFS/exFAT
/dev/sda4       915726335   976771071    30522368+   f  W95 Ext'd (LBA)
/dev/sda5       915726336   968652799    26463232   83  Linux
/dev/sda6       968652800   976771071     4059136   82  Linux swap / Solaris

Thanks for help!

Jacajack
  • 694
  • 1
    @michd I've already added image with information about my 'unallocated partition'. It says: "Unable to satisfy all constraints on the partition' – Jacajack Dec 03 '14 at 14:11
  • my bad, there's usually more info to work with – mchid Dec 03 '14 at 14:12
  • Well... It is weird... That's why I'm asking question here. :) Is there any way to simply check filesystem or partition table in Linux? – Jacajack Dec 03 '14 at 14:15
  • Normally gparted does that... So yes, but for you that method seems broken... http://askubuntu.com/questions/182446/how-do-i-view-all-available-hdds-partitions – Tim Dec 03 '14 at 14:27
  • Please file a bug report: https://bugs.launchpad.net/ubuntu/+source/gparted. – psusi Dec 03 '14 at 14:28
  • You can't resize your Ubuntu partition while it is in use anyway. You need to do this from the Ubuntu Live CD. Here is a tutorial on resizing http://www.howtogeek.com/114503/how-to-resize-your-ubuntu-partitions/ – mchid Dec 03 '14 at 14:33
  • Windows chkdsk normally defaults to c:, did you run it on d: as that was the partition you changed. – oldfred Dec 03 '14 at 15:54
  • @mchid Yes, I used chkdsk on drive D: as well as on C:. Now I'm using LiveCD (Pendrive actually) and those screenshots are from LiveCD as well. I'm afraid i hit my HDD partitions count limit. See here – Jacajack Dec 03 '14 at 16:43
  • 1
    It looks like the start of logical partition sda5 is only one sector away from extended partition sda4. For the libparted library, which GParted uses, at least 2 sectors are required. This is to leave space for Linux LILO if I recall correctly. Hence the message "Unable to satisfy all constraints". 1 sector is the bare minimum space needed to store only the Extended Boot Record. – Curtis Gedak Dec 05 '14 at 20:23
  • @CurtisGedak Your answer sounds good. What should I do to fix it? Could you post some simple way to do it? I'm away from my computer now and I'll be able to send more info if you need on Sunday. Thanks. – Jacajack Dec 06 '14 at 11:34
  • That all looks normal. You cannot modify partition that are mounted. The little key symbol means it is mounted. So you have to use live installer which has gparted or use a gparted liveCD. And if you created an encrypted /home then swap is encrypted and gparted cannot see it as it should not. – oldfred Dec 07 '14 at 23:29
  • Thanks for answering! I recreated swap and it is now seen as linux swap. So it is completely normal? This message sounds like serious problem.... – Jacajack Dec 07 '14 at 23:32
  • @CurtisGedak, hrm.. I could have sworn that I had fixed libparted to handle only one sector... Jackajack, are you running an older Ubuntu release? – psusi Dec 08 '14 at 03:36
  • What were you trying to do when you got the error? Looks like another possible bug.. are you running an older Ubuntu release? This shouldn't be possible in 14.10 and I think not even in 14.04. – psusi Dec 08 '14 at 03:36
  • If you had an encrypted /home and create a standard swap, you may be compromising the encryption. – oldfred Dec 08 '14 at 04:39
  • @oldfred I have Ubuntu 14.04 LTS. How should I check if my home is encrypted and what should I do? I don't think I've had encrypted home, besides... I was able to see it from liveCD. – Jacajack Dec 08 '14 at 06:19
  • @Curtis lGedak I have Ubuntu 14.04. – Jacajack Dec 08 '14 at 09:45
  • @psusi Take a look at my fdisk output. It changet though I wrote same partition table as it was. – Jacajack Dec 08 '14 at 10:44
  • I do not have encryption, so not sure. You have to give passphrase to unlock encryption and then it looks like normal system. When use live installer did you have to use your password also? Files when viewed from live installer should not show and are in a .encrypt hidden folder. – oldfred Dec 08 '14 at 15:42
  • @oldfred Well... I don't have to give it my normal Ubuntu user password, but I found something. When my computer starts up my swap is not mounted. I need to mount it by sudo swapon /dev/sda6. I can't hibernate without it, but when I swap it on and hibernate I get error message on startup about disk being not ready (Or something like that - I can do that again and send you photo, If You need). When system is running and I try to mount swap I get swapon: /dev/sda6: software suspend data detected. Rewriting the swap signature. – Jacajack Dec 08 '14 at 15:49
  • What do you mean it changed? What is it now? – psusi Dec 08 '14 at 16:04
  • Well I don't see how it got that way, but I see the problem. sda5 ends on sector 968652799, which means the chained partition table should reside in sector 968652800. It then describes the location of sda6 as also starting in that same sector. In other words, the partition table is actually inside the partition itself, which should not be possible. Fortunately, swap never actually writes to the first sector of the partition, otherwise it would have blown away the partition table. – psusi Dec 08 '14 at 16:14

1 Answers1

0

It is pretty weird but I solved problem (like 75% of it exactly). Here's what I did:

  1. I backuped my partiton table by sudo sfdisk -d /dev/sda > sda-backup.txt
  2. I created file to edit partition table by sudo sfdisk -d /dev/sda > sda-new.txt
  3. I edited my "sda-new.txt" to change partition table and saved it.
  4. I swapped off my /dev/sda6 by swapoff /dev/sda6
  5. I tried writing partition table by sudo sfdisk /dev/sda < sda-new.txt, but I got error bad input or something like that
  6. I decided to restore old partiton table by sudo sfdisk /dev/sda < sda-backup.txt
  7. I opened GParted and I saw my partiions.

I don't know what exactly happened, but I think It works.

Jacajack
  • 694