Format disk + create partition
Is it possible to create a partition and to remove a partion on a disk, with java? Is it also possible to format a disk?
Can anyone help me, or say where I can find more information, I have already looked in the javadocs and in the searchengines...
Tnx on advance
Stefan Parijs
Not directly.
You will have to call a non Java program from your Java program to do this. Either using runtime.exec(...) or JNI.
There are threads here expalining how to use runtime exec. Do a search on the forum.
Consider whether platform dependance is an issue when deciding which approach to take.
Similar Messages
-
How to install OS to Disk 1 Partition 1 with MDT 2012
Hello.
Sorry for my poor English.
I got some pc which have more than one harddisk.I need to deploy windows 7 pro to the second disk.
So,At fist ,I need to format the fisrt partition in seconde disk,i disable the Partition And Format sequence and i add a new sequence name Format Disk 1 Partition 1 to do a command: diskpart.exe %scriptroot%\d1p1.txt。the content of d1p1.txt
is below:
select disk 1
select partition 1
format fs=ntfs quick
assign letter=c
active
exit
but it is fail to do this,because the letter c had sign to the first disk partition 1.If i change the letter in d1p1.txt to another one ,the unattend.xml will not work! I had try to use another diskpart script to remove
the letter of first disk partition 1
select disk 0
select partition 1
remove
select disk 1
select partition 1
format fs=ntfs quick
assign letter=c
active
exit
it will work.But when i login to the windows first time,i will get a error:"Unable
to find the SMS Task Sequencer and the Tasksquence stop.
any one can help me? thanksIf you want to keep the original partition, I would recommend using the client task sequence in a "refresh" mode, start
\\server\deploymentshare$\scripts\litetouch.vbs from the old PC (*NOT* from WinPE), and start the deployment from there.
Keith Garner - Principal Consultant [owner] -
http://DeploymentLive.com -
Disk utility-erasing a HD, creating partition map hanging
Hi all,
I have been given an external Maxtor USB drive, 120 BG, with the need to securely wipe the old information on it. I have used Disk Utility, and zeroed the HD with a 7 times pass. This took 17 hours, and it moved to the "create partition map" stage. It's been doing that for 24 hours and still the progress bar is rolling. All other options are greyed out and nothing can be selected in Disk Utility. I have chosen to format it in Mac OS X Extended, Journaled. There was about 45 GB data on the drive.
Would this amount of time be expected, or has something gone wrong? I hesitate to force quit DU, in case I render the drive unusable. If I do that or shut down the computer, what's likely to happen to the HD? Will I be able to mount it again and start over. Any tips much appreciated.
FrancesHi Frances,
17 hours for the 7-times pass is normal (and usually completely unnecessary unless you work for the CIA). However, the hang at the "create partition map" stage is not normal. I would interrupt it and reformat the drive, since the zeroing is finished anyway.
If this answered your question please consider granting some stars: Why reward points? -
Can I format only one partition on an external hard disk?
I have partitioned my external Hard drive into three different partitions, each of different formats. Two partitions for backing up my macbooks and one to copy to and from my windows PC. I would just like to know if in any way is it possible for me to be able to re-partition one of the partitions, without affecting my Time machine partitions, in case the need be in future.
Yes, provided the partition has sufficient free space.
Open Disk Utility, select the drive's main entry in the list then click on the Partition tab in the main window. Click in the partition you wish to change, then click on the Add [+] button. The partition should divide in half. You can the resize as you need. The blue area you see in each partition represents what is in use. When you have it as you want click on the Apply button. -
Trying to Install Windows 8.1 on my late 2013 21.5" iMac. After I Format the Bootcamp partition, Windows Setup tells me "Windows can't be installed to this disk because it is GPT partitioned." Huh?
You must use the Windows formatter to format your Windows partition NTFS. Please be sure you select the Windows partition otherwise you might end up formatting your OS X partition NTFS.
-
Stuck in Disk Utilities "creating partition map"
I don't know if this is the right place for this topic but here goes.
I just bought a new Maxtor One Touch 4 Plus 500 gig external drive to back up my stuff. I thought Maxtor, for Macs, were pretty much plug and go but it says that I must prepare the drive as Mac OS Extended (journaled)..aka..partition it in order for Mac to recognize it and be able to copy data onto it. Fair enough...but when I go to disk utilities and hit "partition" it starts "creating partition map". The little blue bar starts going...not even an 1/8 of an inch or so annnnnd then just stays there. I waited about 20 minutes before force quiting Disk Utility (in hopes I didn't just hose the drive). I rebooted and tried again...same thing....as a matter of fact it's still going as I write this. I'm so tired of running into issues lately I could scream. WHAT IS UP? Does it take that long to create a single partition on a 500gig drive? (I have it connected through the firewire, not the USB 2.0 port). Help PLEASE! thanks!It does not take more than about 20 seconds to create a partition map If every block is good. You may have a bad block in the first part of the drive.
I suggest you initialize the drive with the "Zero all data" option, while you do not have much written to it. This process takes several hours, but when it completes successfully, you are assured that any bad blocks have been eliminated and the drive has substituted good spare blocks (kept aside for just this purpose). -
Install Failure: Windows cannot be installed to disk 0 partition 1.
I have problem with installation Win7 x64. Installation stops on disk selection with mesage: "Setup was unable to create a new system partition or locate an existing system partition. See the Setup log files for more information". I tried ICH9 controler in mode AHCI and RAID. Loading intel drivers (Ver:8.7.0.1007 and 7.5.0.1017) gives me masage "Windows cannot be installed to disk 0 partition 1." Details: "Windows is unable to install to the selected location. Error: 0x80300001". I can see drives, make new partition and format it.
Spec:
CPU: Intel Q6600
RAM: 4GB
MB: MSI Neo2 FIR (intel P35 and ICH9R)
HDD: 2x 640GB SATA (empty)I had the same problem. On a new build, ASUS P8Z68-V/Gen4, I a pulled a WD 1TB Sata HDD from another computer I had and put it into my new computer. The drive was previously used just as a data drive, not a boot disk. Win 7 didn't want load on it.
I followed the instructions posted by BenFreefly (although abbreviated slightly) and it worked. For reference, here are the steps;
1) After Windows gives you the error, hit SHIFT-F10 to get to the command prompt.
2) From command prompt enter the following commands:
diskpart
list disk
select disk 0 (your disk may be a different number)
clean
create partition primary
exit (exits diskpart)
exit (exits command prompt)
3) Click on Refresh
4) Windows now sees the disk as a primary disk
5) Select the disk and click Next.
From there, Windows will extract files and the install will boot several times.
Phil C.
Wow, that's weird, this is my answer that has been deleted -
RMBP Mid 2014 Windows 7 installer can't create partitions
Hi all,
I have a late 2014 Retina Macbook Pro with 1TB SSD and Intel Iris Graphics (no nVidia). It has been updated to Yosemite 10.10.2.
So for I had good luck installing Windows 8.1 Professional on it via the bootcamp assistant from a USB key. Unfortunately, due to work requirements, I need Windows 7 (compatible VPN clients and proprietary software at a customer). Windows 7 Professional SP1 however won't cooperate. For the record, I off course removed Windows 8.1 first again via BCA.
First problem was that the 16GB Lexar Jumpdrive I used to install Win 8.1 didn't want to boot when it was created by BCA for Windows 7. Even when holding the Option key at boot, it didn't even show in the boot options. Very weird. This was quickly solved by using an 8GB Kingston Datatraveller stick instead which boots fine.
The BCA does all its stuff correctly then but when booting into Windows 7 and starting the install, the Windows installer first complains it must format the bootcamp partition as NTFS. If I then do that, the installer complains it can't create additional partitions.
OK so let's format it to NTFS. Gone is the BOOTCAMP label.
But Windows refuses to install anyway.
I do not have any additional USB drives inserted, nor is there a Superdrive present. Apple support page said to remove any Thunderbolt devices but there are none.
I have looked for similar threads but the reports there are about the fusion drives in the new 5K iMac and Windows 8.1.
So far I have also tried to format the bootcamp partition as ExFat as suggested in other threads but this makes the Windows 7 installer complain it needs additional drivers for CD/DVD and refuses to install.
This is what I see when I hold the Option key during startup when BCA has created the partition and the USB install drive is inserted:
So I'm kind of out of options. Any help or hint would be appreciated!So this is quite embarrassing. I had already deleted the Windows 7 partition via BCA so to answer your question Loner T, I started BCA again. Unticked create USB installer and download support software and only let it create the Windows 7 partition again. The only difference with last time: I choose 149GB instead of 102GB (thanks to the bloody difficult slider in the BCA).
After bootup of the USB key the install went fine and now I'm looking at a running Windows 7 on my rMBP
Problem is: I have no idea how I solved it. What I did before I posted my question:
- Partition size was 102GB vs 149GB now
- The previous BOOTCAMP partition was erased and reformatted by DiskUtility in ExFat
- It was then removed by BCA
Could this have reset the out of sync MBR vs GPT?
Anyway, it works. Here's the output of the commands:
sudo gpt -vv -r show /dev/disk0
gpt show: /dev/disk0: mediasize=1000555581440; sectorsize=512; blocks=1954210120
gpt show: /dev/disk0: Suspicious MBR at sector 0
gpt show: /dev/disk0: Pri GPT at sector 1
gpt show: /dev/disk0: Sec GPT at sector 1954210119
start size index contents
0 1 MBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
409640 1661515288 2 GPT part - 53746F72-6167-11AA-AA11-00306543ECAC
1661924928 1269536 3 GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
1663194464 672
1663195136 291014656 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
1954209792 295
1954210087 32 Sec GPT table
1954210119 1 Sec GPT header
sudo fdisk /dev/disk0
Disk: /dev/disk0 geometry: 121643/255/63 [1954210120 sectors]
Signature: 0xAA55
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
1: EE 1023 254 63 - 1023 254 63 [ 1 - 409639] <Unknown ID>
2: AC 1023 254 63 - 1023 254 63 [ 409640 - 1661515288] <Unknown ID>
3: AB 1023 254 63 - 1023 254 63 [1661924928 - 1269536] Darwin Boot
*4: 07 1023 254 63 - 1023 254 63 [1663195136 - 291014656] HPFS/QNX/AUX
So I don't really know what I did to solve this... Maybe one of the utils synced the MBR and GPT again? -
MDT Config UEFI Specific disk and partition?
Installing Win8.1 with MDT2013 on UEFI enabled machines everything seems to be ok.. Until... Injecting drivers. The deployment cannot proceed because of destination disk. Sounds obvious because Uefi makes multiple partitions unlike non-uefi that can be installed
on the first partition.
I've created an extra step to the "Format and partition disk" and named it "Format and Partition Disk - UEFI". In this step I've set an option "Task sequence variable IsUEFI equals True". So when it is "True" the step
will format the drive in GPT (as is required for UEFI boot). This seems to work good. I see in the installation the step "Format and Partition Disk - UEFI" when it's a uefi machine, and the original step if it is a non uefi machine. Obviously the
original step will have also an option "Task sequence variable IsUEFI equals False".
The problem comes when we get to the step "Install Operating System". Here I made the same change like I did above. (added extra step with extra option:
The original step "Install Operating System" will have install location: "Specific disk and partition"
Disk 0 Partition 1.
The added step will have install location "Specific disk and partition"
Disk 0 Partition 3. (Because UEFI has multiple partitions)
For some reason the deployment will accept the step "Format and Partition Disk - UEFI" but in the install step it will take the "Install Operating System - Legacy" (so it will try to install to disk 0 partition 1 as I see in BCD log).
Is there any reason that the same condition works at the format step and not at the install step?
We choose the option install to "Specific disk and partition" because of problem when have the location set at "logical drive letter stored in a variable" (problem described:
link)Solution in my case was going for the "logical drive letter stored in a variable" instead of "Specific disk and partition".
Note when applying this: must keep using "OSDisk" variable or it will throw errors (problem described in
this link)
So I deleted the "UEFI" steps, and renamed the "Install Operating System - Legacy" to before. Removed the query for the IsUEFI variable. MDT will automatic install to MBR or GPT based on device. -
Windows 7 Bootcamp refuses to format 20-gig partition to NTFS.
I just recently purchased a Macbook Pro 13-inch Retina at the close of 2012. Have wanted to install Bootcamp (5.1) on it, since I installed Bootcamp on my old Macbook Pro from 2007. Ran into a number of errors and roadblocks, but all were bypassed and there seems to be one final error that I cannot get around.
I am using an official copy, also recently purchased, of Windows 7 64-bit. It's installed as an .iso on a 16-gig flash drive. Upon starting the Windows installation on a 20-gig partition (created by the Bootcamp software), it asks me which partition I want to install Windows onto. I select Partition 4, which says BOOTCAMP, and then select "Advanced Options," where I attempt to have it format the partition from FAT to NTFS. I receive an error message stating that the "the recommended free space for installation is 24895 MB" and it refuses to format it.
There's no possible way that Windows 7 requires 25 GB of free space, I've done the research enough to know that. Why would it tell me that?? What is preventing me from using the install software to format the Bootcamp partition like everyone else seems to be able to do? Is there another issue that I'm missing?
P.S. Not sure if this is related, but there is an oddity in my hard drive's allocation of space: Disk Utility will only allow up to a 20 GB partition, and seems to think that the other 90 GB are necessary for my Mac's startup, even though I have approx 43 GB free, according to the information bar at the bottom of the Finder window.20GB is way to small. Windows 7 requires at least 60GB of hard drive space. 20GB is absolute minimum just for Windows which also needs swap and data space.
Read and follow the Bootcamp Installation instructions. The instructions are available from the first screen when you run Bootcamp Assistant. -
Stuck on Creating Partition Map
I was using the Install disk....the disk utility.....to erase my hard drive and now it is stuck on "Creating Partition Map". What do it do?
I am giving this i-Mac away so I want to make sure the disk is erased. Was it?No, it sounds like there's been a problem. Do the following:
Extended Hard Drive Preparation
1. Boot from your OS X Installer Disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger or Leopard.)
2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Note the SMART status of the drive in DU's status area. If it does not say "Verified" then the drive is failing or has failed and will need replacing. SMART info will not be reported on external drives. Otherwise, click on the Partition tab in the DU main window.
3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, set the partition scheme to GUID (for Intel Macs) or APM (for PPC Macs) then click on the OK button. Click on the Partition button and wait until the process has completed.
4. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
5. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, check the button for Zero Data and click on OK to return to the Erase window.
6. Click on the Erase button. The format process can take up to several hours depending upon the drive size. -
Unnatend disk silent partitioning problem
Hi, everyone. I'm haveing problems with setting up unnatend.xml file for WDS service.
The problem is setup keeps asking me "where do you want to install windows?" i.e. it keeps showing me UI part with disk selection. Even if i click "next" without manually creating partitions, setup proceeds and creates everything as it
described in .xml file. Can I make WDS to silently proceed with disk partitioning, without asking me to select destination disk?
Here's my xml
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SetupUILanguage>
<UILanguage>en-us</UILanguage>
</SetupUILanguage>
<InputLocale>en-us</InputLocale>
<SystemLocale>en-us</SystemLocale>
<UserLocale>en-us</UserLocale>
</component>
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<WindowsDeploymentServices>
<Login>
<Credentials>
<Domain>mydomain</Domain>
<Password>mypass</Password>
<Username>myuser</Username>
</Credentials>
<WillShowUI>Never</WillShowUI>
</Login>
</WindowsDeploymentServices>
<DiskConfiguration>
<Disk wcm:action="add">
<CreatePartitions>
<CreatePartition wcm:action="add">
<Order>1</Order>
<Size>350</Size>
<Type>Primary</Type>
</CreatePartition>
<CreatePartition wcm:action="add">
<Order>2</Order>
<Type>Primary</Type>
<Extend>false</Extend>
<Size>30000</Size>
</CreatePartition>
<CreatePartition wcm:action="add">
<Extend>true</Extend>
<Order>3</Order>
<Type>Primary</Type>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Order>1</Order>
<PartitionID>1</PartitionID>
<Format>NTFS</Format>
<Active>true</Active>
<TypeID>0x7</TypeID>
</ModifyPartition>
<ModifyPartition wcm:action="add">
<Order>2</Order>
<PartitionID>2</PartitionID>
<Label>System</Label>
<Format>NTFS</Format>
<Letter>C</Letter>
</ModifyPartition>
<ModifyPartition wcm:action="add">
<Format>NTFS</Format>
<Label>Data</Label>
<Letter>D</Letter>
<Order>3</Order>
<PartitionID>3</PartitionID>
</ModifyPartition>
</ModifyPartitions>
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
</Disk>
<WillShowUI>Never</WillShowUI>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>2</PartitionID>
</InstallTo>
<WillShowUI>Never</WillShowUI>
</OSImage>
</ImageInstall>
</component>
</settings>
<cpi:offlineImage cpi:source="source here" />
</unattend>Hi strange walker,
Are you trying to install system on new computer? Please confirm the “WillWipeDisk” and “Create Partitions” has set as true.
The related KB:
Step-by-Step: Basic Windows 7 Deployment for IT Professionals
http://technet.microsoft.com/en-us/library/dd349348(WS.10).aspx
Performing an Unattended Installation
http://technet.microsoft.com/en-us/library/dd637990(WS.10).aspx
I’m glad to be of help to you!
We
are trying to better understand customer views on social support experience, so your participation in this
interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place. -
Install windows 7 64 bit on an already created partition
Hi,
I'm new to bootcamp, and frankly having windows run on my macbook pro scares the **** out of me. I have to reformat my harddrive anyway, install OSX 10.6, docs & apps... since it's running too slow at startup by now. I want to take the opportunity to install windows on it as well now.
As i want to keep all windows related files etc... as far away from my mac files i'm thinking to reformat my hardrive in 2 partitions. One big partition for OSX 10.6 and everying else, and a small one lets say 25 or 30 gb for windows.
I looked around on this forum and elsewhere... is this the (save) way to go? I don't find any info regarding this approach, always is mention to start bootcamp and have it made a partition on your harddrive. If i understand this correctly, this is a buggy way to go, partitioning a bootable drive while data is still on it...Hi Koen,
I can understand your concerns about the 'live-partitioning' approach of the BootCamp Assistant.
However I never had any problems when using it with my Macs and never had any kind of data-loss using it.
But since you seem to have some sort of backup od your important files (otherwise you won't start the 10.6 install..), you have done all that is neccessary in case of disaster.
Apples BootCamp Installation Guide can be found here http://www.apple.com/support/bootcamp/
Best practise is to print it out and follow it.
On the other hand if wanna go that route you outlined, you can do it with Windows 7.
Format the second partition with FAT32 (MS-DOS in OSX Disk Utility) and during the WIndows 7 installation reformat it to NTFS since that's what Windows 7 needs but OSX cannot do.
And think more in the area of 40GB or above for Windows 7. 25-30GB are a bit too small.
Regards
Stefan -
Hello, I am trying to reset my macbook pro to its factory settings but I can't type the name of the formatted disk nor can I click on erase, as this feature is disabled. The 'type name' space and the 'erase' button are in light grey - Could you please assist?
Hello!
Did you boot to the Internet Recovery Partition?
Here’s how:
1/ Make sure your computer is completely shut down.
2/ You’ll have to be quick next: Press the Mac’s power button. As soon as you either hear the loud chime, or see the display light up - usually after a second or 2 - on your keyboard press [alt] + [cmd] + [r] Keep these keys on your keyboard pressed until you see a spinning globe with the text “starting Internet Recovery” You might have to connect to your Wi-Fi network before you can continue here.
After a few minutes, you’ll be presented with a Utilities screen. This is the Internet Recovery partition. If this step is already giving you problems, try using a USB-keyboard. It doesn’t have to be an Apple-keyboard. If you have a Windows-tailored keyboard laying around, use the “Windows-flag” key in stead of the [cmd]-key and it should also work.
3/ Choose Disk Utility and click [continue] -
Format disks in a non-global zone
Hi
Can i format a disk inside a non global zone which has been assigned (add device) to this non-global zone.
thanksIn order to allow managing his/her disk to the zone "administrator".
This is what i�ve got when i try to format the disk in the non-global zone:
AVAILABLE DISK SELECTIONS:
0. c4t600A0B8000179A5000002EFD42AFC76Fd0 <SUN-CSM100_R_FC-0610 cyl 20478 alt 2 hd 64 sec 64> sx2_v2
ssd22 at scsi_vhci0 slave 0
1. c4t600A0B8000179A5000002F0A4355CEE9d0 <SUN-CSM100_R_FC-0610 cyl 20478 alt 2 hd 64 sec 64>
ssd24 at scsi_vhci0 slave 0
Specify disk (enter its number): 1
selecting c4t600A0B8000179A5000002F0A4355CEE9d0
[disk unformatted]
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
format> format
Ready to format. Formatting cannot be interrupted.
Continue? yes
Beginning format. The current time is Thu Nov 10 12:59:50 2005
Inquiry failed
failed
Warning: Unable to get capacity. Cannot check geometry
Warning: error reading backup label.
Warning: error reading backup label.
Warning: error reading backup label.
Warning: error reading backup label.
Warning: error reading backup label.
Maybe you are looking for
-
Is there a solution to extreme congestion?
At our office building, there are approximately 150 businesses, all of them small, the majority of which are using wireless for their internet access, and I would venture to guess that a majority of those are using airports. My company was using an A
-
Does anyone know of a service or website that supplies information on stocks (similar to what Yahoo finance shows in its website) but that would be accessible via a Windows Communication Foundation program. For a time I used http://www.webservicex.ne
-
Same Condition type with different G/L Accounts
Dear All, Our customer wants to maintain different set of G/L accounts with the same condition types in case of Service tax. We have three different condition types for Service taxes. JSV4 - Service tax JES4 - ECS on Service tax JSE5 - SECS on Servic
-
Hello, I have a issue with adding used DCs. I have one external library DC...say "extlib" This has all the jar files required. I have one Portal standalone DC...say "portaldc1" This portal dc has java classes in the src.API package. These classes req
-
Complete workitem and proceed further.
Hi All, My Scenarion is: I have an Activity->Task, in which i am using a standard BOR 'FORM' to open approval screen, but in this BOR we do not have any events. Now i want to use terminating event within this task. I tried to use my custom BOR for th