-2

Few days back I started running into Disk Usage problems so I allocated more space on my partition (80 GB). However, I don't think it worked.

If I run diskutil list I get this ("Unix" is the partition I created):

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:          Apple_CoreStorage Macintosh HD            499.4 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

/dev/disk1 (internal, virtual):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS Macintosh HD           +499.1 GB   disk1
                                 Logical Volume on disk0s2


/dev/disk2 (disk image):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        +86.2 GB    disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:                  Apple_HFS Unix                    85.9 GB    disk2s2

However, df -h still reports 50 GB as the total size of the partition I had created (\Volume\Unix).

Filesystem      Size   Used  Avail Capacity iused      ifree %iused  Mounted on
/dev/disk1     465Gi  252Gi  213Gi    55% 1365753 4293601526    0%   /
devfs          190Ki  190Ki    0Bi   100%     658          0  100%   /dev
map -hosts       0Bi    0Bi    0Bi   100%       0          0  100%   /net
map auto_home    0Bi    0Bi    0Bi   100%       0          0  100%   /home
map -fstab       0Bi    0Bi    0Bi   100%       0          0  100%   /Network/Servers
/dev/disk2s2    50Gi   47Gi  2.5Gi    96% 1698634 4293268645    0%   /Volumes/Unix

Moreover, "Unix" partition is not even using 47GB of space. Running ncdu under /Volume/Unix gives this:

.  10.8 GiB [##########] /pkg-cache
    5.0 GiB [####      ] /workspace
   10.4 MiB [          ] /.fseventsd
   12.0 KiB [          ]  .DS_Store
!   0.0   B [          ] /.DocumentRevisions-V100
!   0.0   B [          ] /.Trashes
!   0.0   B [          ] /.TemporaryItems                                                                                                                                                                                                                                             
e   0.0   B [          ] /.bats

How do I fix this?

  • 1
  • Thanks for the down vote! Yes, this seems related. Can you explain what this answer means? What does re-sizing filesystem means? resize2fs doesn't exist on Mac. Also this doesn't explain my disk usage is 47Gb when I am using on 15 GB. I have tried mounting my partition as mentioned here but that isn't working either. I just get "mount_hfs: -o bind: option not supported" – Chirag Agrawal Jun 06 '19 at 01:29
  • I didn't down vote. That was already there when I linked the dupe. I'm not sure about Mac options, sorry. I was also going to comment that ncdu only shows space in use, but I didn't because I also don't know why it only adds up to 15 GB. – Sparhawk Jun 06 '19 at 01:31
  • As your partition is part of a disk image, you could try to unmount and (re)mount it, but I can't tell if this changes anything: hdiutil detach /dev/disk2 && hdiutil mount name_of_DMG. Another option (after unmounting) could be another resize attempt like: hdiutil resize -size 80g name_of_DMG – Freddy Jun 06 '19 at 02:24
  • Tried all of that. But it didn't change anything. – Chirag Agrawal Jun 06 '19 at 02:27

1 Answers1

0

Apologies as I do not have enough reputation to comment on posts. So I can't ask if you used the GUI program Disk Utility or the command line utility when attempting to resize, or you encountered any errors etc. The GUI version of Disk Utility gets worse with every relsease of Mac OS and I avoid using it whenever possible.

Hopefully the following will help:

You can run the diskutil resizeVolume command to resize partitions.

If you run diskutil resizeVolume /dev/disk2s2 limits it should give you information about how big you can grow the partition.

After running that, you can grow your partition to the desired size as any number up to the size returned as max in:

Maximum (constrained by map space): maxGB

e.g.

diskutil resizeVolume /dev/disk2s2 maxGB

You may need to use sudo to run the diskutil resizeVolume command.

justinjt
  • 76
  • 1
  • 5