Can't see linux partitions after resizing [SOLVED]

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Teddy_the_Bear

Can't see linux partitions after resizing [SOLVED]

Post by Teddy_the_Bear »

Hello,

I succesfully installed Mint next to Windows 7 thanks to the topic here: http://forums.linuxmint.com/viewtopic.p ... 13#p467713

But I could not hibernate, so I decided to enlarge the swap partition and shrink the data partition. While resizing, I got an error from Gparted: "ERROR: Current NTFS volume size is bigger than the device size! Corrupt partition table or incorrect device partitioning?"
It shows the current volume size as 263GB and device size as 262GB, i.e. the same size I was shrinking.

I couldn't use the resized partition so I decided to fix it with testdisk - now the data partition works fine but I can't see the linux partitions nor boot into it. Booting with live cd und using gparted shows whole disk unallocated (!) :( and disk manager in windows shows the linux partitions to be empty (100% free space).... Now I worry to do anything else by myself:)

I am afraid I corrupted the master partition tabel and I don't know how to fix it
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Pierre
Level 21
Level 21
Posts: 13226
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: Can't see linux partitions after resizing

Post by Pierre »

does Gparted, from another live_cd show the C; drive as NTFS & sd well as the data partition, as well ??.

or just as "empty".

BTW: did you use the Disk Manager, from within W7 to shrink that partition ?
there is a issue with Gparted, in shrinking either a W6 or W7 based partition.
you Must use the D/M from M$ & then proceed with the 'nix live_cd after that is done.
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
Teddy_the_Bear

Re: Can't see linux partitions after resizing

Post by Teddy_the_Bear »

gparted shows whole disk unallocated, so it looks like empty (I did not try any other live cd-the cd is ok)

sadly I used the gparted to shrink the data partition - my bad, I didn't know about the issue: (
But now, the DiskManager in W7 shows the linux partitions to be empty - so what shall I do with them.
wayne128

Re: Can't see linux partitions after resizing

Post by wayne128 »

I had this before, probably about three times.
gparted show nothing but all unallocated.

I used fdisk to re write partition table and it solved the issue. YMMV

first, on root terminal, type
fdisk -l <enter>

to see if you can get a nice standard partition table.
if you can, then you are in good shape

next , assuming your hard disk is /dev/sda

fdisk /dev/sda <enter>

this will show below

Code: Select all

lmde32x wayne # fdisk /dev/sda

Command (m for help): 
next, type m <enter> to show a list of command, as below

Code: Select all

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)
next , you must be careful, DO NOT accidentally type d, delete!!!
what you need is p and w

type p <enter> to get fdisk to list partition table, it should show exactly the same output as fdisk -l for confirmation. when you see this you are closer

next type w <enter>, this means write the partition table to hard disk, and you should see this below

Code: Select all

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
lmde32x wayne # 
just ignore that error 16, now it automatically exit fdisk and return to # prompt.

type gparted <enter> and hope for the best..

good luck
User avatar
Pierre
Level 21
Level 21
Posts: 13226
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: Can't see linux partitions after resizing

Post by Pierre »

first, on root terminal, type
fdisk -l
do that - again - - to check the hdd again.
then run Gparted.
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
oobetimer

Re: Can't see linux partitions after resizing

Post by oobetimer »

EASEUS Partition Master may see those partitions what Windows does not see.

http://www.download.fi/jarjestelma/kova ... r_home.cfm

Check the next discussion also -- > http://forums.linuxmint.com/viewtopic.php?f=46&t=79941
Teddy_the_Bear

Re: Can't see linux partitions after resizing

Post by Teddy_the_Bear »

wayne128 wrote: first, on root terminal, type
fdisk -l <enter>
This is my result of fdisk -l. I think it is all corrupted - see the starts and endings of the sectors. And also the sizes:

Code: Select all

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 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: 0x1a25016d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         154     1228800    7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2             154        4740    36842332+   7  HPFS/NTFS
/dev/sda3            4740       36795   257476732+   7  HPFS/NTFS
/dev/sda4           36795       38914    17027766    f  W95 Ext'd (LBA)
/dev/sda5           36795       37038     1951736   82  Linux swap / Solaris
/dev/sda6           37038       38914    15069184   83  Linux
Shall I still follow the wayne`s manual? Or not?
SimonTS

Re: Can't see linux partitions after resizing

Post by SimonTS »

I can't see anything wrong with that table. What you have is;-

Device Boot Start End Blocks Id System
/dev/sda1 * 1 154 1228800 7 HPFS/NTFS Your 1st Primary partition
Partition 1 does not end on cylinder boundary. I get this message all the time - ignore it
/dev/sda2 154 4740 36842332+ 7 HPFS/NTFS Your 2nd Primary partition
/dev/sda3 4740 36795 257476732+ 7 HPFS/NTFS Your 3rd Primary partition
/dev/sda4 36795 38914 17027766 f W95 Ext'd (LBA) An Extended partition taking up the rest of the disk
/dev/sda5 36795 37038 1951736 82 Linux swap / Solaris Your first Logical partition (swap space)
/dev/sda6 37038 38914 15069184 83 Linux Your 2nd Logical partition (Linux Mint /)

The Extended partition would 'overlap' the following partitions as they have to live 'inside' it.
wayne128

Re: Can't see linux partitions after resizing

Post by wayne128 »

Teddy_the_Bear wrote:
wayne128 wrote: first, on root terminal, type
fdisk -l <enter>
This is my result of fdisk -l. I think it is all corrupted - see the starts and endings of the sectors. And also the sizes:

Code: Select all

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 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: 0x1a25016d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         154     1228800    7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2             154        4740    36842332+   7  HPFS/NTFS
/dev/sda3            4740       36795   257476732+   7  HPFS/NTFS
/dev/sda4           36795       38914    17027766    f  W95 Ext'd (LBA)
/dev/sda5           36795       37038     1951736   82  Linux swap / Solaris
/dev/sda6           37038       38914    15069184   83  Linux
Shall I still follow the wayne`s manual? Or not?
OK, you got a good partition table from fdisk -l

now just follow, no harm

fdisk /dev/sda <enter>

p <enter> ======this will show exactly what you already had on fdisk -l as confirmation

w <enter>=====this will write partition table by fdisk onto the hard disk, and return to # sign

once you get into # you are out of fdisk and you can type gparted to verify it works

good luck
Teddy_the_Bear

Re: Can't see linux partitions after resizing

Post by Teddy_the_Bear »

OK, I did all and I still see the whole HDD unallocated in gparted and the linux partitions empty in the windows diskmanager..
I still can't see GRUB nor boot into linux (just windows)...


So what now?
oobetimer

Re: Can't see linux partitions after resizing

Post by oobetimer »

Teddy_the_Bear wrote:OK, I did all and I still see the whole HDD unallocated in gparted and the linux partitions empty in the windows diskmanager..
I still can't see GRUB nor boot into linux (just windows)...


So what now?
Live Puppy Linux & terminal commands

fdisk -l

e2fsck -f /dev/sda6

resize2fs -p /dev/sda6 13500M

fdisk /dev/sda

p

d (delate a swap partition)

5

p

w
Teddy_the_Bear

Re: Can't see linux partitions after resizing

Post by Teddy_the_Bear »

It is quite weird. I typed fdisk -lu and the result is somewhat different:

Code: Select all

 sudo fdisk -lu

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 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: 0x1a25016d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2459647     1228800    7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2         2459648    76144312    36842332+   7  HPFS/NTFS
/dev/sda3        76144383   591097847   257476732+   7  HPFS/NTFS
/dev/sda4       591097878   625153409    17027766    f  W95 Ext'd (LBA)
/dev/sda5       591099904   595003375     1951736   82  Linux swap / Solaris
/dev/sda6       595003392   625141759    15069184   83  Linux
And this is corrupted - see that sda4 ends on a sector beyond the physical end of the drive. As the same story as here:
http://ubuntuforums.org/showthread.php?t=1642299

EDIT: thanks oobetimer for a hint. Why should I use puppy linux?
oobetimer

Re: Can't see linux partitions after resizing

Post by oobetimer »

Teddy_the_Bear wrote: EDIT: thanks oobetimer for a hint. Why should I use puppy linux?
Some reason it did not work with Mint. Mandriva and Mageia are working as well with resizing..
Teddy_the_Bear

Re: Can't see linux partitions after resizing

Post by Teddy_the_Bear »

So I did all you guys said and no effect - still only unallocated space and no linux booting. So I deleted all linux partitions and tried to make new install. But there's a new trouble...

I have three primary partitions (sda1 - rescue and recovery and boot, sda2 - windows 7/boot, sda3 - data) and I want to shrink the data partition and install linux as in my previous thread: http://forums.linuxmint.com/viewtopic.p ... 13#p467713

But I can't do that as xenopeek told me to. Before, it went all well.

Now If I create / partition (as primary) I can't create swap (OK, I can create it later, I said to myself - but I couldn't do it after installation nor I could acces other partitions on the disk).

If I create swap, I can't create / as primary = no booting

I guess I have to make the sda3 as extended...somehow...to involve primary / partition. Or is it safe to make sda3 as logical? (I have all my important data on it)
wayne128

Re: Can't see linux partitions after resizing

Post by wayne128 »

Teddy_the_Bear wrote:So I did all you guys said and no effect - still only unallocated space and no linux booting. So I deleted all linux partitions and tried to make new install. But there's a new trouble...

I have three primary partitions (sda1 - rescue and recovery and boot, sda2 - windows 7/boot, sda3 - data) and I want to shrink the data partition and install linux as in my previous thread: http://forums.linuxmint.com/viewtopic.p ... 13#p467713

But I can't do that as xenopeek told me to. Before, it went all well.

Now If I create / partition (as primary) I can't create swap (OK, I can create it later, I said to myself - but I couldn't do it after installation nor I could acces other partitions on the disk).

If I create swap, I can't create / as primary = no booting


I guess I have to make the sda3 as extended...somehow...to involve primary / partition. Or is it safe to make sda3 as logical? (I have all my important data on it)
You do not need to change sda3, if there are a lot of free , unallocated space after sda3.

What you do is to create all the rest of the unallocated space as an
EXTENDED partition.
Once it is done, it become sda4 Linux extended.
Within sda4, you are free to create a lot of logical partition, starting from sda5,6, to ....many .
so you just create a / and a swap as required by your 'allocated size' then let the rest of the space be unallocated.
the unallocated space can become new logical partition ( many ) , data partition, etc.
Teddy_the_Bear

Re: Can't see linux partitions after resizing

Post by Teddy_the_Bear »

OK, now I got it! Thank you and sorry for such a newbie question. Partitioning si messy :-)

solved.

(not the original problem - "solved" by reinstall)
Locked

Return to “Installation & Boot”