Solved

fdisk in a script

Posted on 2001-09-06
4
1,604 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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 fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now