bin/92723: [feature request] fdisk(8) should be able to output current slice table in configuration file format

Alex Kozlov spam at rm-rf.kiev.ua
Fri Mar 9 09:00:29 UTC 2007


The following reply was made to PR bin/92723; it has been noted by GNATS.

From: Alex Kozlov <spam at rm-rf.kiev.ua>
To: bug-followup at FreeBSD.org, jau at iki.fi, spam at rm-rf.kiev.ua
Cc:  
Subject: Re: bin/92723: [feature request] fdisk(8) should be able to output
	current slice table in configuration file format
Date: Fri, 9 Mar 2007 10:52:01 +0200

 On Fri, Mar 09, 2007 at 07:30:10AM +0000, Jukka A. Ukkonen wrote:
 >  Quoting Alex Kozlov:
 >  > 
 >  > fdisk -s is close enough
 >  
 >   If you are willing to do somewhat slow and also error prone
 >   manual labor to recreate the exact same slices you have had
 >   on another disk, then it is close enough.
 >  
 >   If you want a production level approach to be always able
 >   to automatically rebuild the same slices from another disk,
 >   it is not close enough.
 >   You now have to either manually convert the incompatible
 >   current output to a compatible input file or manually feed
 >   whatever slice specifications to rebuild.
 >   Neither of which is really "production quality automation".
 fdisk -s $dev|perl -ne 'if(/^(.*?):\s+(\d+)\s+cyl\s+(\d+)\s+hd\s+(\d+)\s+sec/)\
 {print "g c387621 h16 s63\n"}elsif(/^\s+(\d+):\s+(\d+)\s+(\d+)\s+([\da-z]+)\
 \s+([\da-z]+)\s*$/){print "p $1 $4 $2 $3\n";if ($5 eq "0x80"){print"a $1\n"}}'
 
 Too lazy to write in awk or shell. Sorry.
 
 >   We already have bsdlabel/disklabel reading and writing the                                  
 >   same format which allows copying and rebuilding the exact                                   
 >   same partitions.                                                                            
 >   We already have "mount -p" to print out all currently mounted                               
 >   volumes or individual new mount points as fstab entries to                                  
 >   automate mounting selected volumes to the same locations they                               
 >   are currently mounted to.
 Generally, I do not object against this functionality. But more useful
 enhancement to fdisk like pr 68312 or 40597 were not commited, so this
 has a slim chances.
 
 
 --
 Adios
 


More information about the freebsd-bugs mailing list