Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Sep 1996 20:37:49 -0700
From:      Darryl Okahata <darrylo@hpnmhjw.sr.hp.com>
To:        rhh@ct.picker.com
Cc:        hackers@freebsd.org
Subject:   Re: fdisk changes, anyone? 
Message-ID:  <199609210337.AA000537071@hpnmhjw.sr.hp.com>
In-Reply-To: Your message of "Fri, 20 Sep 1996 18:08:14 EDT." <199609202208.SAA27475@elmer.ct.picker.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
>      As for myself, my current make-ufs-zip script, which currently has in
> it this nasty mess:
> 
>    fdisk -u /dev/${DEVICE} << !EOF!
>    n y 165 1 196576 y 0 1 1 95 63 32 y y 0 0 0 n y y 0 0 0 n y y 0 0 0 n y
>    y 0 y y
>    !EOF!

     Well, with my fdisk manglings, it now looks something like (this
example fully initializes the disk, as opposed to editing existing
partitions):

	fdisk -i -f - /dev/${DEVICE} <<EOF
	g c95 h63 s32
	p 0 165 1 196576
	EOF

Alternatively, if you don't care about making MSDOS/Windows/XXX-
compatible partitions, you should be able to use:

	fdisk -i -f - /dev/${DEVICE} <<EOF
	f 196576
	EOF

(Using 'echo ... |' would be even better.)  This dedicates the entire
disk to FreeBSD, and recovers 31 sectors not used in the first case
(when creating "compatible partitions", my fdisk changes round the start
sector up to an head boundary, which wastes 31 sectors in the first
example).

>      Though this isn't rocket science, I can see the benefit of having this
> in a config file for newbies that just want to be able to store files on a
> UFS ZIP disk and don't know or even want to know about how to set up what
> cylinders, heads, and sectors go into their UFS slice.

     Umm, my changes are aimed at the EXPERT user.  With these changes,
it's just too easy to accidentally blow away an existing disk.  When a
config file is used, there is no pretty confirmation query asking the
user if he really wants to amputate his toes and other sensitive body
parts ....

> But as they'll
> still want to build a script to pull the fdisk, disklabel, and newfs into
> one convenient "just do-it" command, its arguable and not much extra effort
> for them to just pull this script out of the mailing list archives.

     Oh, yes.  That's been my goal all along.  I want a nice little tool
that does everything, and making fdisk non-interactive was step #1.
However, what I really want is a nice, screen-oriented, sysinstall-like (;-) 
tool.  I'd also like to be able to use it for disaster-recovery (e.g.,
on a fixit-like disk).  Unfortunately, this means that I'll probably
have to write the user-interface in C, which begs the question, "Why
don't I drop-kick fdisk and use libdisk instead?" (I discovered libdisk
after I had finished most of my fdisk modifications).  I don't have an
answer for this.  Any opinions?

[ Instead of writing a C program, I'd love to write a Perl5 script.
  Unfortunately, not only would this make disaster-recovery impossible
  (perl is too big), and would force the user to install the optional
  perl5 package, but it would force the user to install an optional
  perl5 module to get access to curses.  Bleah.  ]

     -- Darryl Okahata
	Internet: darrylo@sr.hp.com

DISCLAIMER: this message is the author's personal opinion and does not
constitute the support, opinion, or policy of Hewlett-Packard, or of the
little green men that have been following him all day.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609210337.AA000537071>