1 (edited by vacaloca 2009-03-25 22:15:08)

Topic: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

Yesterday I wanted to shrink my Vista partition of my Vaio's notebook computer. My notebook originally contained one partition of about 9GiB (at start of disk) with some Vista recovery stuff, and the following 240GiB with Vista, and I was only using about 100giB of that.

I tried shrinking the partition from Vista, but when selecting how much to shrink it by it defaulted to 0 and I couldn't change that value. I read in some places that this tool didn't work tool well and I chose to use GParted.

I got into GParted and defined I wanted to shrink the vista partition by 60GiB. Everything seemed to work ok, I let GParted finish and then I restarted my machine. After restarting I get "A disk read error occurred" followed by "Press Ctrl+Alt+Del to restart". Of course, pressing those keys doesn't help.

So I went back to gparted and I saw the following partitions!:
Recovery: 9Gib (ok)
Unallocated: 6Gib (??? what the..)
vista: ~175 Gib (ok)
Unallocated: 60 gib (ok)

1) Any ideas why this could be failing? I don't have a Vista recovery disk because that is supposed to be in the first partition. Still, I can't access that partition because of the before mentioned error.

2) Why do I have a new 6Gib unallocated partition in there??

Thanks in advance for any help.
Regards
AB

2

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

A1)  To fix Vista, it may help to read FAQ point number 9.

The FAQ also outlines how to download a Vista recovery disk image.  smile

A2)  Good question.  I am not sure why there would be such a large gap between partitions.  GParted defaults partition boundaries to round to cylinders, which at most are 8 MB in size.  This is significantly smaller than 6 GB so it does not appear to be a partition boundary rounding problem.

Did you happen to save the gparted_details.htm file when you resized the partition?  If so this would contain useful information that might help us to determine what happened.

3

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

arrrrgg... silly me and the FAQ. I've been searching for quite a bit, but all I got was HD physical errors. Thanks for the update.

Btw, I haven't saved that file but will do in a future. Is there any way to remove that gap from the recovery partition and the main vista one?

4

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

Ok, I still have the same problem. I tried everything I read, including the things in the FAQ. I used bcdedit with no success, vista recovery disk, etc. I always end up with the "A disk read error occurred"...(it actually has the error O missing, like "A disk read err r occurred").

Anyways, ideas? bcdedit's information looks ok. I can't burn a CD or DVD so I can't use other tools available on the internet, just my recovery disk + recovery VAIO partition and a GParted bootable CD.

Any thoughts more than welcome!

5

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

UPDATE: When I access the recovery console, I CAN go to my C: drive and all files seem to be there. Could it be that the BIOS is notfinding where the MBR is stored or something? I think I read somewhere about BPB (Bios Parameter Block) but since he was talking about 8GB discs I thought it was and old thing smile

again, any help is much appreciated.
thanks in advance!

6 (edited by cmdr 2009-03-20 18:01:26)

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

Hello vacaloca,

using "GParted Live CD", would you please give us the print-out of "Terminal"(console) command

fdisk -l -u

where "l" is a lower-case L, or you use the below described drive information file.

Furthermore, I would like to have the hexadecimal content of sectors 0 (MBR) to 9 of your HDD.

How do you get it ?

First of all, we need an independent storage media like an USB stick or an external USB harddisk to store files permanently, so that they can be sent to a file sharing site (e.g. mediafire.com), and you can give us the links.

1. Attach your USB-Media
2. Boot "GParted" ( maybe Boot sequence has to be changed)
3. Write down or keep in mind the device name of your USB-Media, e.g. sdb1 (you see it with GParted's graphic; use your media's device name in the following commands, wherever "sdb1" is used), and your HDD's name ( sda or ? ), minimize "GParted" window
4. Open "Terminal" and write down (press [ENTER] after each line):

mkdir /mnt/usb
mount /dev/sdb1 /mnt/usb

5. Close "Terminal" window
6. Right-click anywhere on Desktop - Fluxbox opens - File/System utils - start MC_HxEd
7. Before you click on the [+] sign, double-click on the text of the single visible line, creating
a drive info file "drvs.dat", which gets automatically stored to the USB media ( location, see below)
8. Now click on every [+] sign to unfold treeview
9. Choose "Show_Block(s)" below your HDD's device name, type

0#10

for sector 0 to 9 .What you see, gets automatically stored to the USB-media (subfolder /BootRec,
as BLK-File (sorry, BLK-Files do NOT )).
10. Shutdown "GParted" and give us the two files.

Regards
cmdr

7

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

Excellent! I was reading and playing around a little bit with MC_HxEd so I kinda know how to get those; thanks for the explanation tho as I can use it to make sure I am doing things right.

Sadly I can't bring my notebook to work, but I'll try this as soon as possible. This was exactly what I was hoping for!

Thanks
VL

8

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

Ok done! Sorry for the delay and helps for the help. Here are the files:
http://www.mediafire.com/?sharekey=9467 … f6e8ebb871

I also included 63#10 just in case.

THAAANKKK YOUUUU!

9

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

and here is a screenshot and the .dat file

http://www.mediafire.com/?sharekey=ede0 … 0a1ae8665a

10 (edited by cmdr 2009-03-23 21:20:00)

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

Hello vacaloca,
well done !

1) "63#10" is empty as expected. Due to "fdisk.log", recovery partition sdb1 (file system ID 0x27) starts at sector 2048 (instead of 63 = 1 track), which is usual with that kind of partition, and ends at block 18782207 (-> size : 18,782,207 - 2,048 +1 = 18,780,160 blocks ->  * 512 /1,024/1,024/1,024 -> 8,96 GiB). Could you please upload the sector content of "2048#30" ?

2) Gap : 18,796,049 - 18,782,208 + 1 = 13,842 blocks -> *512/1,024/1,024 -> 6,76 MiB
Start of Gap is NOT aligned to a cylinder border (next border : 18796050, see 3). That is, the Gap is due to cylinder alignment !
Could you please upload the sector content of   "18782208#80" , to see, what was there before your action ? A Partition Boot Record ?

3) Vista : 406,475,119 - 18,796,050 + 1 = 387,679,070 blocks -> *512/1.024/1,024/1,024 ->184,86 GiB. Start of Vista partition is aligned to a cylinder border. Vista partition has bootflag.
Could you please upload the sector content of  "18796050#30" ?

Regards
cmdr

11 (edited by vacaloca 2009-03-20 19:14:17)

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

Sure thing! Thanks again for your help!

here they are: http://www.mediafire.com/?sharekey=ede0 … 0a1ae8665a

About #2: that partition was created automatically by GParted when I chose to shrink the NTSF partition. Before that part #1 and #3 (which used to be #2 tongue ) had no space between them, so it is very likely that boot info is in there.

12

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

Maybe I found the mistake ! Just try it, explanation follows.
Note, that you need the mounted second drive(USB stick?). Perhaps device name of your HDD is "sdb2" again. Check it and use the right device name (I use a question mark instead)!

You get direct access by clicking on "sd?2" within "MC_HxEd"; edit ([F2]) the four bytes and save it afterwards ([F6]). "MC_HxEd" detects the change and asks, whether you want to overwrite the present block. Say "Yes". Shutdown "GParted", remove the stick and boot your laptop.

First three 16-byte lines of your corrupted sd?2 PBR look like this

EB 52 90 4E 54 46 53 20 20 20 20 00 02 08 00 00
00 00 00 00 00 F8 00 00 3F 00 FF 00 [00 98 1E 01] <- Last 4 bytes seem to be false
00 00 00 00 80 00 80 00 50 83 1B 17 00 00 00 00

I have 2 variants, which should be tested
1)

EB 52 90 4E 54 46 53 20 20 20 20 00 02 08 00 00
00 00 00 00 00 F8 00 00 3F 00 FF 00 [00 08 00 00]
00 00 00 00 80 00 80 00 50 83 1B 17 00 00 00 00

2)

EB 52 90 4E 54 46 53 20 20 20 20 00 02 08 00 00
00 00 00 00 00 F8 00 00 3F 00 FF 00 [12 CE 1E 01]
00 00 00 00 80 00 80 00 50 83 1B 17 00 00 00 00

Good luck !
cmdr

13

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

I'm trying it as I write.
Would it be too much to ask the meaning of those bytes and what was actually broken? smile

14 (edited by vacaloca 2009-03-20 21:51:55)

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

YYYYYYYYYESSSSSSSSSSSS!!!! first one worked!!! I guess you changed the pointer to the MBR?

THANK YOU SOO MUCH!!! genius!.. Still if you could explain what was happening in a little bit more detail that would be super!

UPDATE: Actually first solution pointed to first partition, second solution to the other one smile So both of your solutions worked great, it was just a matter of choosing which one to use smile

15 (edited by cmdr 2009-03-20 23:24:12)

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

Hello vacaloca,
congratulations wink . If you were not so skilled with my "baby" MC_HxEd, we wouldn't have had such an ultrafast solution !

As a "reward", I point you to my newest update of "MC_HxEd", which you can download via this thread(use the last link). I would appreciate your opinion. You just put it to your USB stick, launch "GParted", mount the stick and copy it to "/usr/bin", thus overwriting the present version. Start it as usual with "Fluxbox".

And now, the requested explanations :

About #2: that partition was created automatically by GParted when I chose to shrink the NTSF partition. Before that part #1 and #3 (which used to be #2 tongue ) had no space between them, so it is very likely that boot info is in there.

It seems to be a NTFS file table, containing some "Adobe" programs. This might have been used as an intermediate storage, while "GParted" was working. The original content was probably overwritten. Your assumption may be right, but we can't prove it anymore.

The four bytes, we corrected, are the "Hidden Sector Bytes", which normally indicate the "unused" area in front of the first primary partition, where msdos Master Boot Record (sector 0) resides or perhaps a Linux bootloader (Grub). On a normal HDD you find value 0x0000003F there, which is 63, the size of the first track on a lba drive. Your drive has value 0x00000800 (=2,048), which was my first variant ( MSB / LSB order gives 00 08 00 00). The second used the starting block of the second primary partition (Vista) : 0x011ECE12 (=18,796,050), thus hiding the Recovery partition and the unallocated alignment space, too. The fact, that both variants work, surprises me. The original value pointed to the starting block of the unallocated alignment space in front of the second primary partition.
It was just my assumption, that this might be false, because I don't know exactly, why this value is needed here; it could be easily checked in Master Boot Record. Maybe it's for redundancy or timing reasons.

Perhaps you give a bug report to the "GParted" team (cylinder alignment is a good thing, but the chosen value for the "Hidden Sectors" is obviously not).

So long
cmdr

PS: Please don't forget to put [SOLVED] to this thread by editing your first post again and adding it to the title

16

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

oohhh.. damn Little Endian Intel. I did that conversion (hex to int) to see if it matched one of the sectors, but I forgot this was little endian.

So, just to clear up things.

If you can't boot your Vista  (or whatever) and the Vista Recovery disk doesn't work (i.e. you still have the same read error problem).

1. Identify the starting sectors of your HD's partitions
2. Identify which partition you want to boot from smile Convert that value to hex, invert the words (double bytes) and invert the bytes themselves. So 0x011ECE12 becomes 12 CE 1E 01.
3. Use the most excellent MC_HxEd tool and open up the broken partition. Change bytes 28, 29, 30 and 31 (zero based) and save
4. Restart without any CD/DVD: vista will complain that something is broken
5. Insert vista recovery CD/DVD and make sure it boots. It will automatically detect you screw up and fix it
6. Next restart you will be as good as new.

Thanks Again and I really hope this helps another idiot like me smile
Regards
VL

17

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

Thanx!

I've had the same problem after shrinking/moving a Vista-Partition with GParted. With Your description it was easy to make it work again.

Thanx,
  Michael

18

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

hi I have the same problem... I know how to do everything what vacaloca wrote to point 2. I use Mac with bootcamp.

1: I identyfied partition
2: 84566160 -> 0x050A6090 -> 90 60 0A 05

and could you tell me step-by-step how to use MC_HxEd to change bytes and which bytes I have to change (and what I have to write).

thanks

19

Re: [SOLVED]Error Shrinking Vista Partition - A disk read error occurred

Hello limpfred,

your Mac emulates a Windows environment, things are not quite the same than with pure Windows. "MC_HxEd" only works , if "fdisk" passes correct values.  Mac uses EFI structure for booting and simulates a MSDOS Master Boot Record. I doubt whether "fdisk" (which runs with "GParted", when Mac OS is NEVER active), shows reliable values. How do you know for sure, whether your "Hidden Sector" value is realy true ?

Regards
cmdr