Solved

fdisk in a script

Posted on 2001-09-06
4
1,617 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Congratulations! You’re Certified – Now What?

Starting a new career can be overwhelming. Becoming certified in your field of expertise is a great start, but where do you go from here?  Here are some tips to help you on your career journey.

Question has a verified solution.

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

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…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

636 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