LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-05-2006, 02:46 AM   #1
wucan
LQ Newbie
 
Registered: Mar 2006
Posts: 6

Rep: Reputation: 0
Question How to auto fdisk?


I know the fdsik not support script process, but I want to apply the same step to other disks, the disks number is large and this is the reason I want auto fdisk. Could someone gave me a hint?
 
Old 06-05-2006, 02:53 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
If the drives all have the same geometry:

Get partition info:
Code:
dd if=/dev/hda of=mbr_part_table bs=512 count=1

Set partition info:
Code:
dd if=mbr_part_table of=/dev/hda bs=512 count=1

Should be quite scriptable if you put the resulting file from step
one close to the script ;}


Another alternative would be expect.
man expect for details - most distros provide it.


Cheers,
Tink

Last edited by Tinkster; 06-05-2006 at 02:54 AM.
 
Old 06-05-2006, 03:07 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,842

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
sfdisk - designed for the job. See the man page.
 
Old 06-05-2006, 03:15 AM   #4
wucan
LQ Newbie
 
Registered: Mar 2006
Posts: 6

Original Poster
Rep: Reputation: 0
ok, thanks all, I will try these now.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
weird fdisk problem (Fdisk unable to see winxp partitions) khidot Slackware - Installation 5 04-07-2007 10:26 PM
How do I auto start modules that aren't auto loaded on boot? darkbluedrew Debian 2 09-18-2005 10:10 AM
eth0 Auto Connect, How to auto start on logon cornish Linux - Networking 2 05-09-2005 01:02 PM
auto-completion - how does it work & can my script args auto-complete? BrianK Programming 1 06-11-2004 05:51 PM
autofs enabled in kernel but auto.mount and auto.master are NOT in /etc! Alybyzrp Linux - General 0 11-11-2003 01:26 PM


All times are GMT -5. The time now is 07:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration