1

Topic: HFS-Plus volume size bigger than device size

Hi there,

I just wanted to resize a hfsplus partition on an external usb drive and got the well-known error, that the filesystem is bigger than the partition.
The parted version is 1.8.8, GParted 0.4.5, they are both compiled on my own machine (I'm using Gentoo).

Unfortunately I can't post the output of fdisk, as it doesn't support GUID Partition Table.

By the way, I'm able to mount the volume, but the disk free space seems incorrect.

# fdisk -l -u

[...]

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Platte /dev/sdb: 500.1 GByte, 500107862016 Byte
255 Köpfe, 63 Sektoren/Spur, 60801 Zylinder, zusammen 976773168 Sektoren
Einheiten = Sektoren von 1 × 512 = 512 Bytes
Disk identifier: 0x00000000

   Gerät  boot.     Anfang        Ende     Blöcke   Id  System
/dev/sdb1               1   976773167   488386583+  ee  GPT

# parted /dev/sdb
GNU Parted 1.8.8
Verwende /dev/sdb
Willkommen zu GNU Parted! Geben Sie 'help' ein, um eine Liste der verfügbaren
Kommados zu erhalten.
(parted) unit s                                                           
(parted) print                                                            
Modell: SAMSUNG HD501LJ (scsi)
Festplatte  /dev/sdb:  976773168s
Sektorgröße (logisch/physisch): 512B/512B
Partitionstabelle: gpt

Nummer  Anfang      Ende        Größe       Dateisystem  Name  Flags
 1      34s         683164124s  683164091s  hfs+                    
 2      683164125s  976768064s  293603940s  ext3                    

(parted) check 1                                                          
Warnung: Die Partition 1 hat 683164091s, aber das Dateisystem hat 771973096s.
Ignorieren/Ignore/Abbrechen/Cancel? Ignore                                
Fehler: Das Dateisystem ist größer als sein Datenträger!                  
Ignorieren/Ignore/Abbrechen/Cancel? Ignore                                
Keine Implementierung: Überprüfung von Dateisystemen ist für hfs+ noch nicht
implementiert.
(parted) quit

# cd /mnt
# mount /dev/sdb1 sdb1
# mount /dev/sdb2 sdb2
# mount
[...]
/dev/sdb1 on /mnt/sdb1 type hfsplus (rw)
/dev/sdb2 on /mnt/sdb2 type ext3 (rw)
# dmesg | tail
[...]
hfs: write access to a journaled filesystem is not supported, use the force option at your own risk, mounting read-only.
kjournald starting.  Commit interval 5 seconds
EXT3 FS on sdb2, internal journal
EXT3-fs: mounted filesystem with writeback data mode.
# df
[...]
/dev/sdb1            385986548 330994112  54992436  86% /mnt/sdb1
/dev/sdb2            144492840    192128 136960616   1% /mnt/sdb2


# cd
# cat gparted_details.htm 
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='de-DE' lang='de-DE'>
<head>
<meta http-equiv='Content-Type' content='text/html;charset=utf-8' />
<title>GParted-Details</title>
</head>
<body>
<p>GParted 0.4.5</p>
<p>libparted 1.8.8</p>
<table border='0'>
<tr>
<td colspan='2'>
<b>/dev/sdb2 (ext3, 97.53 GB) von /dev/sdb löschen</b>&nbsp;&nbsp;00:00:00&nbsp;&nbsp;&nbsp;&nbsp;( ERFOLG )
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<table border='0'>
<tr>
<td colspan='2'>
/dev/sdb2 kalibrieren&nbsp;&nbsp;00:00:00&nbsp;&nbsp;&nbsp;&nbsp;( ERFOLG )
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<table border='0'>
<tr>
<td colspan='2'>
<i>Pfad: /dev/sdb2<br />Anfang: 772235280<br />Ende: 976773127<br />Größe: 204537848 (97.53 GB)</i>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border='0'>
<tr>
<td colspan='2'>
Partition löschen&nbsp;&nbsp;00:00:00&nbsp;&nbsp;&nbsp;&nbsp;( ERFOLG )
</td>
</tr>
</table>
</td>
</tr>
</table>
<p>========================================</p>
<table border='0'>
<tr>
<td colspan='2'>
<b>/dev/sdb1 von 368.11 GB auf 325.76 GB verkleinern</b>&nbsp;&nbsp;06:56:44&nbsp;&nbsp;&nbsp;&nbsp;( ERFOLG )
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<table border='0'>
<tr>
<td colspan='2'>
/dev/sdb1 kalibrieren&nbsp;&nbsp;00:00:01&nbsp;&nbsp;&nbsp;&nbsp;( ERFOLG )
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<table border='0'>
<tr>
<td colspan='2'>
<i>Pfad: /dev/sdb1<br />Anfang: 34<br />Ende: 771973129<br />Größe: 771973096 (368.11 GB)</i>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border='0'>
<tr>
<td colspan='2'>
Dateisystem auf /dev/sdb1 auf Fehler überprüfen und (falls möglich) diese beheben&nbsp;&nbsp;00:48:05&nbsp;&nbsp;&nbsp;&nbsp;( ERFOLG )
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<table border='0'>
<tr>
<td colspan='2'>
<b><i>fsck.hfsplus -f -y /dev/sdb1</i></b>
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<table border='0'>
<tr>
<td colspan='2'>
<i>** /dev/sdb1<br />** Checking HFS Plus volume.<br />** Checking Extents Overflow file.<br />** Checking Catalog file.<br />** Checking multi-linked files.<br />** Checking Catalog hierarchy.<br />** Checking Extended Attributes file.<br />** Checking volume bitmap.<br />   Volume Bit Map needs minor repair<br />** Checking volume information.<br />   Invalid volume file count<br />   (It should be 4694360 instead of 4694363)<br />   Invalid volume free block count<br />   (It should be 13748109 instead of 13748106)<br />   Volume Header needs minor repair<br />(2, 0)<br />** Repairing volume.<br />** Rechecking volume.<br />** Checking HFS Plus volume.<br />** Checking Extents Overflow file.<br />** Checking Catalog file.<br />** Checking multi-linked files.<br />** Checking Catalog hierarchy.<br />** Checking Extended Attributes file.<br />** Checking volume bitmap.<br />** Checking volume information.<br />** The volume Mac was repaired successfully.<br /></i>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border='0'>
<tr>
<td colspan='2'>
Dateisystem verkleinern&nbsp;&nbsp;05:28:05&nbsp;&nbsp;&nbsp;&nbsp;( ERFOLG )
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<table border='0'>
<tr>
<td colspan='2'>
libparted wird verwendet
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border='0'>
<tr>
<td colspan='2'>
Partition von 368.11 GB auf 325.76 GB verkleinern&nbsp;&nbsp;00:00:01&nbsp;&nbsp;&nbsp;&nbsp;( ERFOLG )
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<table border='0'>
<tr>
<td colspan='2'>
<i>Alter Anfang: 34<br />Altes Ende: 771973129<br />Alte Größe: 771973096 (368.11 GB)</i>
</td>
</tr>
</table>
<table border='0'>
<tr>
<td colspan='2'>
<i>Neuer Anfang: 34<br />Neues Ende: 683164124<br />Neue Größe: 683164091 (325.76 GB)</i>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border='0'>
<tr>
<td colspan='2'>
Dateisystem auf /dev/sdb1 auf Fehler überprüfen und (falls möglich) diese beheben&nbsp;&nbsp;00:40:32&nbsp;&nbsp;&nbsp;&nbsp;( ERFOLG )
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<table border='0'>
<tr>
<td colspan='2'>
<b><i>fsck.hfsplus -f -y /dev/sdb1</i></b>
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<table border='0'>
<tr>
<td colspan='2'>
<i>** /dev/sdb1<br />** Checking HFS Plus volume.<br />** Checking Extents Overflow file.<br />** Checking Catalog file.<br />** Checking multi-linked files.<br />** Checking Catalog hierarchy.<br />** Checking Extended Attributes file.<br />** Checking volume bitmap.<br />   Volume Bit Map needs minor repair<br />** Checking volume information.<br />   Invalid volume free block count<br />   (It should be 13748109 instead of 2646983)<br />   Volume Header needs minor repair<br />(2, 0)<br />** Repairing volume.<br />** Rechecking volume.<br />** Checking HFS Plus volume.<br />** Checking Extents Overflow file.<br />** Checking Catalog file.<br />** Checking multi-linked files.<br />** Checking Catalog hierarchy.<br />** Checking Extended Attributes file.<br />** Checking volume bitmap.<br />** Checking volume information.<br />** The volume Mac was repaired successfully.<br /></i>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border='0'>
<tr>
<td colspan='2'>
Dateisystem bis zum Auffüllen der Partition vergrößern&nbsp;&nbsp;&nbsp;&nbsp;( NICHT VERFÜGBAR )
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<table border='0'>
<tr>
<td colspan='2'>
<i>Das Vergrößern ist auf diesem Dateisystem nicht verfügbar</i>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p>========================================</p>
<table border='0'>
<tr>
<td colspan='2'>
<b>Primäre Partition Nr. 1 (ext3, 140.00 GB) auf /dev/sdb erstellen</b>&nbsp;&nbsp;00:01:39&nbsp;&nbsp;&nbsp;&nbsp;( ERFOLG )
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<table border='0'>
<tr>
<td colspan='2'>
Leere Partition erstellen&nbsp;&nbsp;00:00:01&nbsp;&nbsp;&nbsp;&nbsp;( ERFOLG )
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<table border='0'>
<tr>
<td colspan='2'>
<i>Pfad: /dev/sdb2<br />Anfang: 683164125<br />Ende: 976768064<br />Größe: 293603940 (140.00 GB)</i>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border='0'>
<tr>
<td colspan='2'>
Partitionstyp auf /dev/sdb2 festlegen&nbsp;&nbsp;00:00:01&nbsp;&nbsp;&nbsp;&nbsp;( ERFOLG )
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<table border='0'>
<tr>
<td colspan='2'>
<i>Neue Partitionstyp: ext3</i>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border='0'>
<tr>
<td colspan='2'>
Neues ext3-Dateisystem erzeugen&nbsp;&nbsp;00:01:37&nbsp;&nbsp;&nbsp;&nbsp;( ERFOLG )
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<table border='0'>
<tr>
<td colspan='2'>
<b><i>mkfs.ext3 -L &quot;&quot; /dev/sdb2</i></b>
</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>
<table border='0'>
<tr>
<td colspan='2'>
<i>Dateisystem-Label=<br />OS-Typ: Linux<br />Blockgröße=4096 (log=2)<br />Fragmentgröße=4096 (log=2)<br />9192960 Inodes, 36700160 Blöcke<br />1835024 Blöcke (5.00%) reserviert für den Superuser<br />Erster Datenblock=0<br />Maximale Dateisystem-Blöcke=4294967296<br />1120 Blockgruppen<br />32768 Blöcke pro Gruppe, 32768 Fragmente pro Gruppe<br />8208 Inodes pro Gruppe<br />Superblock-Sicherungskopien gespeichert in den Blöcken: <br />    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, <br />    4096000, 7962624, 11239424, 20480000, 23887872<br /><br />Schreibe Inode-Tabellen: erledigt                        <br />Erstelle Journal (32768 Blöcke): erledigt<br />Schreibe Superblöcke und Dateisystem-Accountinginformationen: erledigt<br /><br />Das Dateisystem wird automatisch nach jeweils 36 Einhäng-Vorgängen bzw.<br />alle 180 Tage überprüft, je nachdem, was zuerst eintritt. Veränderbar mit<br />tune2fs -c oder -t .<br /></i>
</td>
</tr>
</table>
<table border='0'>
<tr>
<td colspan='2'>
<i>mke2fs 1.41.9 (22-Aug-2009)<br />Warnung: 332 Blöcke unbenutzt.<br /><br /></i>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p>========================================</p>
</body>
</html>

2 (edited by gedakc 2009-12-23 21:22:17)

Re: HFS-Plus volume size bigger than device size

Have you written any data to the ext3 file system, or is it still empty?

The reason I ask the above question is because my knowledge of the hfs+ file system is limited.  I do not know if I can simply change part of the file system to indicate a smaller size.  If this is not possible we might need to increase the size of the encompassing partition to hold the original size of the hfs+ file system.

Also, could you provide the output of the following command from your gentoo installation?

uname -a

Since you mentioned that you are able to mount the hfs+ file system, it would be wise to make a backup of your data.

3

Re: HFS-Plus volume size bigger than device size

# uname -a
Linux Erdbeere 2.6.31-tuxonice-r7-doggie #4 SMP Fri Dec 18 08:23:40 CET 2009 x86_64 Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz GenuineIntel GNU/Linux

The partition was empty as I posted last. In the meantime I've done the following: Repaired the volume on using a Mac's Disk Utility. Although it said to have failed, the size of the partition was corrected.
And I wrote data to the ext3-fs, which worked fine.

I can still mount both and looks like there's been no data overwritten.

4

Re: HFS-Plus volume size bigger than device size

When GParted shrunk the hfs+ file system and it's partition, all data above the new partition boundary would have been moved below this boundary.  Then when the "failure to inform kernel of partition changes" occurred, the hfs+ file system would have grown to the size of the old partition.  No data should have been moved with this grow operation.

Thus no data should have been lost.

Did you try the Mac Disk Utility repair again to see if it successfully passed on a second try?

5

Re: HFS-Plus volume size bigger than device size

I don't think that's correct: The Mac's Disk Utility did not grow the file system to the old partition size. It seems to have corrected the values for the file system length and free disk space to fit to the new partition size. Unfortunately I did not save the error msg, but I will give it a second try soon.

6 (edited by gedakc 2009-12-24 18:30:21)

Re: HFS-Plus volume size bigger than device size

gedakc wrote:

When GParted shrunk the hfs+ file system and it's partition, all data above the new partition boundary would have been moved below this boundary.  Then when the "failure to inform kernel of partition changes" occurred, the hfs+ file system would have grown to the size of the old partition.  No data should have been moved with this grow operation.

Sorry for the confusion.  The above quoted section is in reference to actions by GParted.  I did not mean to imply that the Mac Disk Utility repair action "grew" the file system.

My hope is that the Mac Disk Utility repair action would correct the hfs+ file system to fit within the partition boundaries.

7

Re: HFS-Plus volume size bigger than device size

doggie, I have a same problem.
how did you fix?

8

Re: HFS-Plus volume size bigger than device size

I believe Intel based Macs use a hybrid GPT and MBR partition scheme.   If these get out of sync you can use a tool called rEFIt to resync these partition tables.  See the GParted FAQ for more information.

9

Re: HFS-Plus volume size bigger than device size

hallo @all
I am new here,my first problem and at moment I cannot good seeing, my right eye is ill.
I have many years partitions hdd-discs with gparted. but now I have an error with my first external (express card usb3.0) samsung ssd via ubu 12.04 64bit. updated today. where I have to send the file: gparted_details.htm. my error:
GParted 0.11.0 --enable-libparted-dmraid
libparted 2.3
...
Neues ext4-Dateisystem erzeugen  05:02:24    ( FEHLER )
mkfs.ext4 -j -O extent -L "Beso-SSD" /dev/sdf1
...
Erstelle Journal (32768 Blöcke): erledigt
Schreibe Superblöcke und Dateisystem-Accountinginformationen: 1/954
mke2fs 1.42 (29-Nov-2011)
Warnung: Probleme beim Schreiben der Superblöcke.
please help me and thanks
bb

10

Re: HFS-Plus volume size bigger than device size

beso_berlin,  please create a new post for the problem to avoid confusion with this thread on HFS+ volumes.