Mac GeekeryGet your geek on. |
|
blog advertising is good for you
recent popular content
User login
|
The recent release of 10.4.6 brought about a new feature required for Boot Camp to do its magic – nondestructively resizing volumes. Apple updated the The Finder doesn’t really like you toying with
$ diskutil resizeVolume disk1s2 limits
For device disk1s2 USB1:
Current size: 99686268928 bytes
Minimum size: 1118990336 bytes
Maximum size: 99686268928 bytes
First, we need to reduce the size of the existing volume. I still want this volume fairly large, so let’s make it 75GB.
In my case with an external, reboot is not necessary. However, the Finder dislikes us playing with At any rate, we’ve slipped up slightly. We wanted three partitions, but I only have one plus a bunch of free space. Here’s the bummer. At all. Here’s what we wanted to do.
That’s really three statements. First, diskutil resizeVolume disk1s2 70G shrinks the existing volume to 70GB. JHFS+ USB2 10G creates a new partition in the free space that is formatted as Journaled HFS+, volume titled USB2, and 10GB in size. MS-DOS USB3 10G does the same, but creates a FAT32 volume. If we sanely eject the existing volume and cycle power on the drive, it’ll remount as a 70GB. Where are the other two?
And now we have three volumes where we once had but one.
About JC
Author Biography JC is a former Mac Genius and Mac-centric IT worker with a background in print advertising. He earned a reputation as a miracle worker when he saved the day at a new business pitch with the arcane knowledge that Apple’s ADB cables were nothing more than poorly shielded S-Video cables. JC runs the Heroic Efforts Data Recovery Service and writes Ungenius, a tawdry tale of the life and times of a former Mac Genius. You can contact JC via IM or via the contact form. |
According to AFP548, the disk must be GPT partitioned.
http://www.afp548.com/article.php?story=20060405181503909
And try as I may, I can’t make a GPT-partitioned disk image to play with.
Guess I’m waiting on an iMac. :\
This should take care of that little problem:
http://homepage.mac.com/jochs/files/GPT.zip
Surely ‘Non-destructively resize a disk. You may increase or decrease its size.’ as the help for the utility says, means it WONT overwrite data?
That’s the theory. JC’s too chicken to try it on real data, though.
I’d do it, but I have PPC machines.
when i say “non-destructively”, i more mean that you don’t have to reformat the whole disk.
I have a couple of reasons for expecting that data in the affected portions might be lost:
1) if the volume is full, there’s nowhere to move it except into the newly created volume.
2) the newly created volume is not formatted automatically. you have to format it.
Thus, if it does move any data into that new volume, you have to erase it to make that volume mount.
I’ll make some dummy data using
ddand/dev/randomto be sure, though.resize wont let you resize to any arbitrary amount, theres a minimum size, which appears to be about a gig more than current free space on the partition, and I’ve seen errors reported in boot camp that partition cant be resized due to not being able to move data, both of which lead me to believe the statement that it is by design non destructive.
aha. so edited….
Does anyone think that this would work on my Bootcamp’d windows parition?
I only made my win partition 10 gigs and would now like to make it 20 gigs without having to start over.
Thoughts?
I should mention that I have 39 gigs free on the OSX part so I have the room and the 5 gig buffer too.
this only allows you to modify the end point of a volume, as far as i can tell, so it wouldn’t help you much here. what you could do, though, is shrink your OS X partition and reclaim the last space to be formatted as a second drive for use in Win.
thank you. looks like I will have to Norton Ghost and re-Bootcamp it though.
Hello there,
Please, Please, don’t ignore the messages the command line give you. It is NOT ok to ignore the reboot message. diskutil resize is changing the paritiion map of the boot disk. Those changes cannot be reflected in the OS until a restart. disktool -r will just cause to pain and suffering in this case.
If you resize on a external drive, you MUST eject and DETACH it from the system, until the original /dev/disk nodes are gone (this usually takes a few seconds).
resizevolume can’t move the start of a partition, it’s just shrinking an existing JHFS+ volume.
There are two cases where this will fail:
-Your volume fails a verify. Before resizing, resizevolume does a fsck of the volume in question. If that fails, the resize will fail, and you’ll need to use diskutility to repair it.
-There are files can cannot be moved in order to accomidate your resizing request. The filesystem resizing routines have some limitations on what files it can move. There are a few metadata files that can’t be moved, so if they happen to be in the space you’re trying to free up, the resize will fail. Note that in some cases the filesystem doesn’t know if there are files it can’t move before it starts. Thus, there will be cases where it actually moves some number of files before exiting. In these cases, the disk should still be ok.
Hi,
I have been trying to resize my Mac hard drive using resizeVolume but keep getting the error : “Resizing encountered error No space left on device (28) on disk.” after verification is done. I have plenty of space (128GB) so I am thinking it may be due to the second reason you have given (unmovable metadata). I am a bit of a newbie so I was wondering what these metadata are and what is the solution to this?
This is the command I am using: sudo diskutil resizeVolume disk0s2 20G “HFS+” MacData 50G “MS-DOS FAT32” XPDATA 50G “MS-DOS FAT32” Windows HD 20G
I am keeping a seperate MacData so I can play around with large ISOs DVDs etc. which won’t be possible on FAT32.
This is what I get with diskutil list:
/dev/disk0 #: type name size identifier 0: GUID_partition_scheme *149.1 GB disk0 1: EFI 200.0 MB disk0s1 2: Apple_HFS Macintosh HD 148.7 GB disk0s2
Would it be possible to receive an email reply (I came across this page via google and will bookmark it but just in case I can’t find the page again)?
I’d be grateful for any help! Aroosha
FYI, I ran into this same problem, and in the end, what I found was that if I did this same command, after doing a “sudo -s” that error went away. Unfortunatly it was replaced with yet another error, “failed for unknown reason error -1”. Then I poked around a lot and found that one could do this same thing from the disk utility on leopard (which I am running) so I just did if from there, and it worked like a champ. FYI, the disk I was working on was an external drive, not the OS disk, so your mileage may varry.
-Chris
Hey, i partitioned my drive when I first got my iMac, but now I can’t use bootcamp because it requires a single-volume drive to work.
Is there a way for me to reduce back to a single volume so I can run bootcamp now? I don’t really want to go through the work of wiping and reinstalling everything.
Anybody think this is possible now?
Thanks…
Ryan
www.pixelgrain.org
It depends on your volumes. If you have the space to condense all of your data onto one volume and then just format the second as FAT32 (for now) then Windows should see it and install on the second properly.
If you have more than two, you’ll need to use a GPT-aware partition table editor to delete the last two partitions and create a single one in its place. For that, I’m unaware as to if diskutil will do it, but on PPC Macs there’s a program called pdisk that could do it. Since JC has the Intel iMac, perhaps he can chime in on that…
pdisk is for APM maps only (Apple Partition map, the PPC map)
fdisk is for MBR maps only (Mast boot record, what’s on your camera flash disks
gpt is for gpt maps only.
HOWEVER, gpt does not understand the partition format that’s used for bootcamp. Using it to create/destroy partitions will not do what you want.
The only thing that will create bootcamp compatible partitions is diskutil under 10.4.6 or later…
Just use Drive Genius.
To Pixelgrain, by using DG, you can copy stuff from the one you want to remove to the one you want to keep, then delete the one you want to remove, and expand the one you keep. Don’t have enough room on the one you want to keep? Then you’ll have to do it a little at a time.
From what I understand DG is only for PowerPC macs at the moment. Intel Macs have a different partition map.
Plus it’s $99! iPartition is much cheaper than that and at least has a demo for the Intel machines.
I’m really hoping to simple merge my empty 2nd partition back into my primary one, it definitely shouldn’t necessitate a 100 dollar app…
Thanks though…
Drive Genius only understands Apple Partition Table drives, not the Intel GUID Partition Table drives. Apple’s utility only works on GPT drives, and is also the only solution for Intel Macs at this point in time.
i also posted this at http://www.afp548.com/article.php?story=20060405181503909
i verified both of the above on my PPC mac (quad G5). however, resizing a GPT volume didn’t work:
[Quadzilla:/Volumes] boli% diskutil resizeVolume /Volumes/bonsai limitsFor device disk3s2 bonsai:Current size: 79716450304 bytesMinimum size: 3515957248 bytesMaximum size: 79716450304 bytes[Quadzilla:/] boli% diskutil resizeVolume /Volumes/bonsai 5GStarted resizing on disk disk3s2 bonsaiVerifyingResizing VolumeResizing encountered error No space left on device (28) on disk disk3s2 bonsaiso it looks like it resizing GPT disks doesn’t work on PPC macs (for now) as suspected by JC, can someone else confirm this?
My iBook cannot boot off of GPT, and I get similar errors when running the tool. Further, the tool is very specific about what it will handle format-wise, so I suspect they merely didn’t consider endianness when creating it, since most (all?) Macs cannot boot off GPT disks.
$ diskutil resizeVolume -help
Disk Utility Tool
Usage: diskutil resizeVolume [Mount Point|Disk Identifier|Device Node] size
Non-destructively resize a disk. You may increase or decrease its size.
When decreasing size, you may optionally supply a list of new partitions to create.
Ownership of the affected disk is required.
Valid partition sizes are in the format of
Valid sizes are B(ytes), K(ilobytes), M(egabytes), G(igabytes), T(erabytes)
Example: 10G (10 gigabytes), 4.23T (4.23 terabytes), 5M (5 megabytes)
resizeVolume is only supported on GPT media with a Journaled HFS+ filesystem.
A size of “limits” will print the range of valid values for the current filesystem.
Example: diskutil resizeVolume disk1s3 10G JHFS+ HDX1 5G MS-DOS HDX2 5G
Valid filesystems: “Case-sensitive HFS+” “Journaled HFS+” “Case-sensitive Journaled HFS+” “HFS+” “HFS” “MS-DOS FAT32” “MS-DOS FAT16” “MS-DOS” “MS-DOS FAT12” “UFS” “Linux” “Swap”
i really could boot my quad G5 off a GPT disk, i’ll gladly post details when i get home.
here’s what i did in short (all on my quad G5):
1. i created a single GPT JHFS+ partition on external 2.5” firewire disk called “bonsai” using 10.4.6’s DiskUtility.
2. then i blockcopied an existing Mac OS X v10.4.4 (PPC) emergency system onto “bonsai” (again using DiskUtility)
3. then tried to boot off “bonsai”, which didn’t work. first there was the usual gray apple in the boot screen, but it changed to a “forbidden” sign (circle with diagonal bar) after a while, at which point the quad’s fans started spinning audibly faster.
4. so i booted off the internal disk and updated the system on “bonsai” to 10.4.6 using the combo update (PPC).
5. after that i booting off “bonsai” again and lo and behold, it worked. yes i did make sure the G5 was booted off the external “bonsai” and not the emergency partition nor the regular partition (both of which are internal).
cheers, oliver
how sure are you that your volumes are still GPT after that block copy? it’s entirely likely that you just block copied the partition map back onto the drive, overwriting the GPT partitions.
(note: i haven’t tried any of this on a PPC mac, so I have no idea what works there and what doesn’t.)
overwriting the target partition map wouldn’t make much sense. the source of the blockcopy was a single 5.5 GB partition of a multi-partition 400 GB disk (that uses APM), whereas the target was a single partition 80 GB disk (that uses GPT).
the terminal output for
)
diskutil listlooks as follows (sorry for the picture, pasting terminal output didn’t look very readable, even withcodetagsfor comparison’s sake my normal boot drive is also shown (it uses APM)
BTW here are the options for partitioning in 10.4.6’s DiskUtility:
edit: accidentally wrote “source” when i meant “target”, corrected now.
Some late model ppc macs will boot from gpt disks, but the vast majority of them will not.
thanks, that’s good to know. do you happen to know which models? obviously the quad G5 is one of them, so i’d guess all dual-core G5 are included?
Resizing does not work on ppc at all. Resizing does not work on APM maps either.
Under 10.4.6, you can only resize JHFS+ volumes on gpt maps on Intel machines.
See my other comment as to why it might fail even in this case…
any suggestions on making one bigger??
is there any command to even increase the size of partition using diskutil or any utility except using any software or CD kind of things
basically as in windows and linux having facility or support of LVM so is there any kind of support or LVM support in Mac Os X
thanks in advance
I have an external USB drive that I once partitioned into a FAT32 partition and a HFS+ partition. Now, I want to make the first one smaller and the second one larger. However ‘diskutil resizeVolume disk2s1 limits’ says: ‘Volume format does not support resizing’. Does this mean I’m out of luck or is there some workaround maybe?
Same problem here: ‘Volume format does not support resizing’ This has worked on another MacBook Pro that is the same model. The partition type looks exactly the same – journaled HFS+. The only difference was a 120GB disk (the failure) instead of 80GB (the success). I’ll post a work around if I ever find one. Any suggestions welcome.
same here: Volume format does not support resizing
I’m trying to do the same on an external hdd, 250gig.
Would love for it to work, so if anyone figures it out, be sure to share!
Any reasons why this method shouldn’t work on a 160GB iPod? I would like to shrink the current partition used for music and data to ~100GB ( JHFS+) and leave the rest unpartitioned to make some windows ones (FAT & NTFS). Will iTunes cease to work if the partition table changes?
oh wait, it has to be GPT partitioned, right?
Ok, I’ll be the first to admit it: I’m an idiot when it comes to these kind of things. Honestly. But here’s what I want, maybe someone can help me.
I have an Intel Mac with a Windows side (sort of like a dark side) but I use it to play games, becuase the games for Windows are a lot cheeper, etc. I recently got a new game, went to install it, and found that I didn’t have enough free space on the Windows side for it. When I partitioned my Mac, back when I got it, I had made the partion too small, and now I want the Windows side bigger. Only problem is that I did that with a Boot Camp Beta version that I can’t use anymore (which is a pain) as it has been uninstalled (which is also a pain). So, here’s my question: will all this complicated stuff help me get what I want? And also, what are the chances that I am going to lose everything? I dont mind if I lose what’s on the Winows side, I never use it anyway, but I would like to keep the Mac side, please.
Thank you SO much!!
Hi, just wanted to say thanks for the info on resizing and reformatting the partitions.
I had OS X10.4.11 running just the way i wanted on my macbook but also wanted to put XP on, just as a test to see how well it would run, but didn’t want to have to reinstall os x and didn’t want to use bootcamp. Followed the instructions on the this site, booted off the XP install disk into a fat32 patition. when doing the xp install you have to change format to ntfs once the installed prompts you to, won’t work if you keep it as a fat32 format. Rest of the install went smooth.
Note: you will need a drivers cd, boot camp has a utility that creates one for you but dont know how to make one or get one if you dont have bootcamp. I luckly managed to find one at my place of work so i was well pleased.
XP rund great on the macbook too
OK< read this, and being literate on Partitioning / resizing on the (excuse my language) Windows machines, I am a little hesitant to run command line diskutil options until I know this will work.
Here goes :
Imac 75 Gb drive, currently partitioned into a 69 Gb Mac OS 10.3 running partition (presumably the initially installed OS), later 10.4 was added, and this is running on the second partition (around 5 Gb).
As you can imagine, this division of 69 / 5 is not really optimal. Can I resize the first , and add the new / empty space to the second partition (non destructive on all operations of course) ?
All hints are appreciated, not a total dummy here, but wish to avoid awkward errors and getting stuck with a non running system
celaeno:~ doce$ diskutil resizeVolume disk1s2 50G disks1s3 25G
That is probalby the comand you want to use (with your own disk names etc), i could be wrong tho so maybe wait until someone smarter verifies. Icould try it on my macbook but unsure as to whether it will work as you want it to and don’t want to ruin my own setup.
When I run the limits cammand i get
[code]
SamsMac:Volumes sfishman$ diskutil resizeVolume “Sammy’s Backup” limits
Error obtaining resizing information
Resizing encountered error on disk disk1s1 Sammy’s Backup: Could not modify partition map (-9986)
[/code]
I already tried repairing using the diskutility gui. nothin.
Any ideas?
Hello,
I can’t resize a volume because it seems to be already at its maximum size, but actually the space does exist and I don’t know how to explain it to him (him = my mac).
What I want to do is simple: my disk have 2 partitions (OS and data) and I want to merge them. So I guess I have to delete the data one and resize the bootable. But how to delete it?
I called ‘eraseVolume’ on data, but the limits of the bootable remained the same. So I resized the data, freeing 40 GB and still the limits are the same. Instead, I do can rechange the size of data, so that the unallocated space can be given only to data and not to the primary volume.
Unmounting data doesn’t change the situation.
Can you please help me? Thanks!!
Alex
I hope that this question falls nicely into this thread. I wish to reclaim the 3 GB or so that are currently unusable on my 40 GB external hard drive, as I really need to move 39 GB file onto it, and it just does not quite fit, unfortunately. What can I do to reclaim this “vacant” space, which is currently used just for formatting the drive? I am on a Mac using OS 10.5.2. Thank you very much for any assistance!!