Solved

fdisk in a script

Posted on 2001-09-06
4
1,608 Views
Last Modified: 2008-03-06
Hello,

I would like to create partitions on a 2nd hard drive in a script.  Is it possible to do an fdisk command in a script?  What would it look like?

Thanks in advance for the help!
0
Comment
Question by:diamond1
  • 3
4 Comments
 
LVL 5

Expert Comment

by:garboua
ID: 6460710
I think you could, but I wouldn't do that.  U probably want to do that interactively.
0
 
LVL 1

Accepted Solution

by:
zmanz earned 100 total points
ID: 6462118
#!/bin/bash
# This example prints out the help and partition info  and then quits.
fdisk /dev/hda <<END
m
p
q
END
0
 
LVL 1

Expert Comment

by:zmanz
ID: 6462170
The above script example uses a here document.
http://www.linuxdoc.org/LDP/abs/html/here-docs.html
0
 
LVL 1

Expert Comment

by:zmanz
ID: 6480842
knock knock
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

777 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