Date: Sat, 6 Mar 2010 00:41:30 -0800 From: Garrett Cooper <yanefbsd@gmail.com> To: Josh Paetzel <jpaetzel@freebsd.org> Cc: freebsd-hackers@freebsd.org, randi@freebsd.org, David Wolfskill <david@catwhisker.org> Subject: Re: Scripting sysinstall(8) to create & use multiple slices on a disk? Message-ID: <7d6fde3d1003060041p225e8718n29a8e75a718237a@mail.gmail.com> In-Reply-To: <201003051233.42861.jpaetzel@freebsd.org> References: <20100304213329.GJ57205@bunrab.catwhisker.org> <201003050801.00440.jhb@freebsd.org> <201003051233.42861.jpaetzel@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Mar 5, 2010 at 10:33 AM, Josh Paetzel <jpaetzel@freebsd.org> wrote: > On Friday 05 March 2010 07:01:00 John Baldwin wrote: >> On Thursday 04 March 2010 4:33:29 pm David Wolfskill wrote: >> > For reasons that may well be idiosyncratic, I like to set up FreeBSD >> > machines to have at least 2 bootable slices -- e.g., one can act as a >> > fallback if an attempted software upgrade proves to have been ill-time= d. >> > >> > In the past, I've done this manually; while a bit tedious & fairly >> > "target-rich" with opportunities for human error, it's something that = is >> > typically done infrequently (i.e., once) in the life of a machine (or = at >> > least its boot drive). >> > >> > At work, the IT folks use a scripted sysinstall(8) to set machines up; >> > to increase the probability that I'll be able to get 3 "special" >> > machines set up the way I want, I'm trying to set up a sysinstall conf= ig >> > file to make this as painless as possible. >> > >> > I managed to get a copy of the config script IT uses, so I had a >> > starting-point ... but they were setting the machines up with >> > >> > partition=3Dexclusive >> > >> > which doesn't seem like a good choice for what I'm doing. =A0:-} >> > >> > >> > After my first attempt failed, I poked around on the Net & found >> > <http://www.nntpnews.net/f2458/what-proper-install-cfg-configuring-mul= tip >> > le- >> >> slices-4387807/>, >> >> > (dated 18-11-08, 10:40 PM ), in which Peter Steele describes something >> > >> > similar to what I was about to try next, and writes: >> > | My intent here is to create three slices-one 6GB in size, another 1G= B >> > | in size, and the third sized to consume the remaining free space. Wh= en >> > | I run this through sysinstall, it complains that it can't find the >> > | space for the partitions. It even complains that it can't find any >> > | free space. Because the slices don't get created, the subsequent lab= el >> > | assignments fail as well. What is the proper commands for creating >> > | multiple slices in install.cfg? >> > >> > In a foillowup, he writes: >> > | After a lot of experimenting, my impression is that sysinstall simpl= y >> > | doesn't support multiple slice installations. It works to a point, b= ut >> > | I get some unexpected errors, e.g. >> > | >> > | Unable to make device node for /dev/ad0s1a in /dev >> > >> > which doesn't seem very encouraging. >> > >> > >> > Would someone please either confirm the limitation or provide a >> > suitable excerpt from a sysinstall config script to demonstrate >> > that it is actually possible? =A0(Or show me where it's spelled out in= the >> > man page....) >> > >> > (I'm using 7.x sysinstall, if that matters.) >> >> If you are doing a fully scripted install you may be better off just usi= ng >> a dedicated shell script to format your disks and mount them and then us= e >> the various *-install.sh scripts from the release distributions to insta= ll >> the code. =A0You could still do this via sysinstall by sticking your she= ll >> script in /stand in the MFS root and having your sysinstall script just >> run that script. You might want to build a custom mfsroot to add some mo= re >> useful tools though. >> >> I really think sysinstall needs to support a disk "backdoor" whereby the >> user can either manually partition disks and then mount them at /mnt (or >> have a script do it), and tell sysinstall to just skip the disk stuff an= d >> assume /mnt is mounted. > > David, > > I second the ditching sysinstall for a shell script idea. =A0A shell scri= pt that > replaces sysinstall is nearly as short as the install.cfg and a lot easie= r to > figure out. =A0I've written a half dozen auto installers for FreeBSD, fro= m > trivial to complex and would be more than willing to help you get somethi= ng > set up. =A0I can send you code if you want as well. (Attempts to avoid shoe flying in his direction from randi@ :/), FWIW, sysinstall(8) is a good starter tool and it has a lot of the information that you need in order to complete an install (especially if you're doing it from scratch), but the amount of effort for using sysinstall(8)'s install.cfg, etc has the greater potential to change in the future when compared with a shell scripted method which is less likely to change; granted gpart vs fdisk is in transition, but the number of steps and the simplicity required to get everything up and going is trivial, and I did so in < 100 lines of bourne shell. I'd be happy to share my custom script if desired as well to provide you a general idea of what could be done to solve your problem. Cheers, -Garrett
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7d6fde3d1003060041p225e8718n29a8e75a718237a>