Solved

FDisk Command Line

Posted on 1998-08-06
19
872 Views
Last Modified: 2013-12-29
I hope that you don't mind a DOS question, since you do not have a catagory for the DOS Operating System.

I would like to be able to run fdisk.exe in a batch file to automatically re-partition a hard drive.  The command line that I have used thus far is fdisk /pri:2500 /ext:2000 /log:2000.  This has yielded a primary dos partition of 2500mb and a logical partition of 2000mb with no logical drive defined.  How can I get the logical drive defined with a drive letter attached to it, without rebooting and and rerunning fdisk from the command line to define that logical drive?
0
Comment
Question by:sholdk
  • 6
  • 4
  • 3
  • +5
19 Comments
 

Author Comment

by:sholdk
ID: 1719567
I have no additional comments
0
 
LVL 8

Expert Comment

by:wayneb
ID: 1719568
The problem is that changes do not take effect until the system has been rebooted, so after creating a primary the system must be rebooted and so on.  I do not think that it can be done.
0
 
LVL 5

Expert Comment

by:jboddy
ID: 1719569
Wayneb is correct, you HAVE to re-boot for fdisk changes to take effect.
Have you tried GDISK from Ghost software (Shareware)??
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:sholdk
ID: 1719570
I agree that this is somewhat true, but you can create a Primary, Extended and Logical drive in the same session if you run it in interactive mode, you just have to select "N" when creating the primary partition so that you don't have to reboot at that time.  This command line is from an OEM manufacturer that they use on their rebuild diskette to reset the system back to the original factory configuration.  I am a technology consultant with a Fortune 500 company and we modify these factory loads to suit our enviroment.  We are currently trying to duplicate this rebuild process for our internal use.
0
 
LVL 17

Expert Comment

by:mikecr
ID: 1719571
My question to you is, how did you manage to get a 2500mb partition in Dos first of all?


Mike
0
 
LVL 1

Expert Comment

by:sKiiKe
ID: 1719572
In interactive mode there is plenty of time to create the extended partition BEFORE the logical drive. Could this be the cause that the logical drive isn't formed with the command line switces
0
 

Accepted Solution

by:
gosowski earned 200 total points
ID: 1719573
sholdk,  IF you want to execute a program within a batch file and have it return to the batch file after the execution your enter a syntax such as:

@call Fdisk /and_any_parameters /or_switches

This will execute the program Fdisk and return to the batch file,,, however the fore comments about the Partition are correct,, thus you must reboot<<<< AHHHH!!!  
Try

@Call Reboot.com

I haven't experienced with this,,, but windows programmers use something similar for their install.  I think you may need to modify an Autoexec.bat file before the reboot,,, thus meaning you copy the contents of a second Batch file Onto the first one After the Reboot  VIOLA!!!!  On the copy command there is a Overwrite Confirmation switch like this::::: copy /Y auto2.bat autoexec.bat
this way you can reboot and continue the execution of the rest of your desired application.

good luck
Gary
0
 

Expert Comment

by:gosowski
ID: 1719574
sholdk,,, here is a link to download the command Reboot.com

http://www.tnet.com.au/software/Win95_Boot_Disk/WIN95BT

good luck,
Gary
0
 

Expert Comment

by:gosowski
ID: 1719575
sholdk,,, I checked out the other link to Reboot.com and the file integrity was corrupt.  But,, this one is ok,, however,, you must un-zip the file first.. thus it is named Reboot.zip

http://home1.inet.tele.dk/ianking/switch95.htm
0
 

Author Comment

by:sholdk
ID: 1719576
Gary,

The problem is when I reboot it only shows the Primary and Extended partitions and no Logical Drive has actually been created.  Do I need to do something else?
0
 
LVL 1

Expert Comment

by:sKiiKe
ID: 1719577
FDISK in autoexec.bat with appropriate switch by copying autoexec.2 to autoexec.bat. However does FDISK automatically boot after modifications? If so this is not possible.

The copying of autoexec.bat shold take place between FDISK and REBOOT commands
0
 

Expert Comment

by:gosowski
ID: 1719578
sKiiKe,,,,
I realize that the lexicographical order may not seem appropriate,,,  It will have to be tested,,,, the question didn't ask for the code,,, therefore I didn't write the code,,,,  I am not sure what your point is because I didn't write Psuedo code,,, I am merely implicating the steps to gain the objective.  Furthermore,,, the reboot command can called where ever it works,,, thus it will have to be experimented with,,,  But  most importantly it is entirely possible.
0
 

Expert Comment

by:gosowski
ID: 1719579
sholdk,  Have you  tried to format the drive after the reboot?
0
 
LVL 1

Expert Comment

by:sKiiKe
ID: 1719580
I wasn't clear enough with my comment. After re-reading the question my comment is slightly beside the point.

However I don't know if this procedure can be achieved without floppy-boot and that's where my thoughts were when I wrote my comment.

Booting with floppydisk with a comment FDISK /pri:2500 /ext:2000 in autoexec.bat. If FDISK didn't boot immediately after
FDISK /pri:2500 /ext:2000 then You could automate the forming of logical drive by copying an alternative autoexec.bat to the place of the original a:\autoexec.bat with commnet FDISK /log:2000 and then REBOOT. On the following reboot the logical drive would be formed. With a third autoexec.3 copied to autoexec.bat with comment Format c: and Format d: would result to the usable drives.

But this was beside the point.
0
 

Expert Comment

by:gosowski
ID: 1719581
sKiiKe,  Sorry,,, I wasn't very clear on my approach,, but yes,, you are correct,,, the system would have to booted by a Floppy or some other removeable media,,,, Thanks for the input
0
 

Author Comment

by:sholdk
ID: 1719582
Gary,

In response to your question, yes I have formatted the drive after successfully creating a primary partition.  But the logical drive does not exist.  If I run fdisk from the prompt then I can re-create and successfully format the logical drive.  I did however possibly find some limitiations of fdisk today.  When using the command line that I indicated above for a smaller drive I was able to succesfully create a primary, extended and logical hard drives on a drive with a total capacity of 850mb.  When using a 4.1GB drive the logical drive is not created.  Any other suggestions?
0
 
LVL 4

Expert Comment

by:dpavusin
ID: 1719583
I think you answered your own question. Fdisk has some serious limitations. You can experiment with latest fdisk from w95 OSR2.X or W98. You must realize OSR and W98 fdisk support FAT32 only - so any partition created with it will be FAT32 partition.
As much as I know command line parameters are the same for W98 and OSR2 fdisk.

Regards,

Damir
0
 
LVL 4

Expert Comment

by:dpavusin
ID: 1719584
Well, would you tell us how you solved your problem? I'm very curious..

Regards,

Damir
0
 

Expert Comment

by:akoluch
ID: 13838783
There is a new fdisk out for larger drives - > 64GB.

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question