From i.jochim at querysoft.de Tue Jan 3 10:00:13 2006 From: i.jochim at querysoft.de (Ingo Jochim) Date: Tue, 03 Jan 2006 11:00:13 +0100 Subject: Interactive in %post? Message-ID: <43BA4B2D.6090201@querysoft.de> I like to run a shell script in the %post section of kickstart. This script needs some interaction (manuell input). How can I do that? Thank you for your help. Ingo From klaus.steden at thomson.net Tue Jan 3 16:53:30 2006 From: klaus.steden at thomson.net (Klaus Steden) Date: Tue, 3 Jan 2006 11:53:30 -0500 Subject: Interactive in %post? In-Reply-To: <43BA4B2D.6090201@querysoft.de> References: <43BA4B2D.6090201@querysoft.de> Message-ID: <20060103165330.GG9429@thomson.net> > I like to run a shell script in the %post section of kickstart. > This script needs some interaction (manuell input). > > How can I do that? > Stick a call to '/bin/sh' or '/bin/bash' or whatever your shell of choice is into the %post section. Make sure you know ahead of time if you want it run in the chroot environment (your new system) or in the install environment, because they have different semantics. hth, Klaus From rh-kickstart at matthouse.com Tue Jan 3 19:39:41 2006 From: rh-kickstart at matthouse.com (Matt Sturtz) Date: Tue, 3 Jan 2006 12:39:41 -0700 (MST) Subject: Interactive in %post? In-Reply-To: <20060103170014.9C1C873975@hormel.redhat.com> References: <20060103170014.9C1C873975@hormel.redhat.com> Message-ID: <4958.64.207.49.98.1136317181.squirrel@www.ontheside.net> >> I like to run a shell script in the %post section of kickstart. >> This script needs some interaction (manuell input). >> > Stick a call to '/bin/sh' or '/bin/bash' or whatever your shell of choice > is into the %post section. I tried this on my system, and I can switch to TTY2 and see the shell running, but don't seem to have any control over it... Is it more complicated than just putting "/bin/bash" on a line by itself? Which TTY should the shell be showing up on? -Matt- From mshuler at rackspace.com Tue Jan 3 20:38:00 2006 From: mshuler at rackspace.com (Michael Shuler) Date: Tue, 03 Jan 2006 14:38:00 -0600 Subject: Interactive in %post? In-Reply-To: <4958.64.207.49.98.1136317181.squirrel@www.ontheside.net> References: <20060103170014.9C1C873975@hormel.redhat.com> <4958.64.207.49.98.1136317181.squirrel@www.ontheside.net> Message-ID: <43BAE0A8.3060003@rackspace.com> Matt Sturtz wrote: > I tried this on my system, and I can switch to TTY2 and see the shell > running, but don't seem to have any control over it... Is it more > complicated than just putting "/bin/bash" on a line by itself? Which TTY > should the shell be showing up on? It will show up where you tell it to, or in your current TTY ;) Try running %post on the first unused TTY: %post # change to new vt and set stout/stdin exec < /dev/tty6 > /dev/tty6 chvt 6 # write or make calls to post-install scripts here # change back to first vt chvt 1 -- Kind Regards, Michael Shuler Rackspace Managed Hosting From teng at dataway.com Tue Jan 3 21:54:14 2006 From: teng at dataway.com (Tedman Eng) Date: Tue, 3 Jan 2006 13:54:14 -0800 Subject: Interactive in %post? Message-ID: <37ED92F9890FAF4BB947613C66FF8B1A08BB2CA6@dw-mail.dataway.com> Check the list archives also for discussion of using the 'dialog' program from a kickstart %post script. There's an assortment of widgets built into dialog that you may find useful. > -----Original Message----- > From: Michael Shuler [mailto:mshuler at rackspace.com] > Sent: Tuesday, January 03, 2006 12:38 PM > To: Discussion list about Kickstart > Subject: Re: Interactive in %post? > > > Matt Sturtz wrote: > > I tried this on my system, and I can switch to TTY2 and see > the shell > > running, but don't seem to have any control over it... Is it more > > complicated than just putting "/bin/bash" on a line by > itself? Which TTY > > should the shell be showing up on? > > It will show up where you tell it to, or in your current TTY ;) > > Try running %post on the first unused TTY: > > %post > # change to new vt and set stout/stdin > exec < /dev/tty6 > /dev/tty6 > chvt 6 > > # write or make calls to post-install scripts here > > # change back to first vt > chvt 1 > > -- > Kind Regards, > Michael Shuler > Rackspace Managed Hosting > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list > From achuzhoy at walla.com Fri Jan 6 13:49:35 2006 From: achuzhoy at walla.com (=?UTF-8?Q?=41=6C=65=78=61=6E=64=65=72=20=43=68=75=7A=68=6F=79?=) Date: Fri, 6 Jan 2006 15:49:35 +0200 Subject: updates.img Message-ID: <1136555374.415000-27233735-28579@walla.com> An HTML attachment was scrubbed... URL: From email at jasonkohles.com Fri Jan 6 14:50:54 2006 From: email at jasonkohles.com (Jason Kohles) Date: Fri, 6 Jan 2006 09:50:54 -0500 Subject: updates.img In-Reply-To: <1136555374.415000-27233735-28579@walla.com> References: <1136555374.415000-27233735-28579@walla.com> Message-ID: <87f4e9820601060650q85485c2wc6e0ebd24f19ae1@mail.gmail.com> On 1/6/06, Alexander Chuzhoy wrote: > > Hi all, > while installing fedora4 with kickstart (from NFS or HTTP server) I face > sometimes cases when NIC is unsupported,thus I'm unable to contact the files > on remote server. > I used to solve this with adding the driver to initrd.img. > Lately I was pointed to the file updates.img . > I have no idea where to take updates.img file from or how to create it. All > I know is that it suppose to be placed under "base" directory in > Fedora/RedHat tree. You can solve most driver problems by putting updated drivers into updates.img, but you can't fix NIC problems that way, since the updates.img will be downloaded over the network if you are doing network installs. -- Jason Kohles email at jasonkohles.com - http://www.jasonkohles.com/ "A witty saying proves nothing." -- Voltaire From teng at dataway.com Fri Jan 6 19:50:27 2006 From: teng at dataway.com (Tedman Eng) Date: Fri, 6 Jan 2006 11:50:27 -0800 Subject: updates.img Message-ID: <37ED92F9890FAF4BB947613C66FF8B1A08BB2CBD@dw-mail.dataway.com> Please dont sent HTML email to mailing lists. Moreover, your email contains script elements. >From /usr/share/doc/anaconda/anaconda-release-notes.txt : The installer will also use an 'updates.img' file to get patched source files. This is particularly useful for FTP and HTTP based installs. When the second stage image is retrieved from the server, a download of the updates.img is also attempted. This file must be an ext2 filesystem image. It is mounted loopback, then the contents are copied to the ramdisk location that Python is setup to look at for module updates. This update image will also work with all the other installation mechanisms, although the exact location where it is expected does vary. The 'install-methods.txt' file has the details on this. >From /usr/share/doc/anaconda/install-methods.txt: - 'updates.img' is a ext2 filesystem containing the updated python sources and modules for anaconda. CDROM - 'updates.img' file in '/RedHat/base' directory of CD #1 image. NFS - 'updates.img' file in 'RedHat/base' directory. FTP/HTTP - 'updates.img' file in 'RedHat/base' directory. -----Original Message----- From: Alexander Chuzhoy [mailto:achuzhoy at walla.com] Sent: Friday, January 06, 2006 5:50 AM To: kickstart-list at redhat.com Subject: updates.img Hi all, while installing fedora4 with kickstart (from NFS or HTTP server) I face sometimes cases when NIC is unsupported,thus I'm unable to contact the files on remote server. I used to solve this with adding the driver to initrd.img. Lately I was pointed to the file updates.img . I have no idea where to take updates.img file from or how to create it. All I know is that it suppose to be placed under "base" directory in Fedora/RedHat tree. Can you please guide me? Thanks in advance. Walla! Mail - get your free 3G mail today From i.jochim at querysoft.de Mon Jan 9 14:33:52 2006 From: i.jochim at querysoft.de (Ingo Jochim) Date: Mon, 09 Jan 2006 15:33:52 +0100 Subject: url prefix wrong Message-ID: <43C27450.1020808@querysoft.de> I modified my kickstart script from using DHCP to a fixed ip address. From: network --bootproto=dhcp --device=eth0 To: network --device=eth0 --bootproto static --ip 192.168.52.171 --netmask 255.255.255.0 --gateway 192.168.52.1 --nameserver 192.168.52.1 With DHCP everything was working fine to download all files from a ftp server. url --url ftp://192.168.52.1/OS_FC4 With a fixed ip address it try's to download the files from a wrong url. It has an additional slash in the url. ftp://192.168.52.1//OS_FC4 On the screen there is a message about url_prefix /OS_FC4. Why is that not working now and how can I set the url_prefix manually? Any ideas? Ingo From i.jochim at querysoft.de Thu Jan 12 15:01:17 2006 From: i.jochim at querysoft.de (Ingo Jochim) Date: Thu, 12 Jan 2006 16:01:17 +0100 Subject: partitions on scsi and ide different ? Message-ID: <43C66F3D.7090401@querysoft.de> On an interactive installation using an IDE drive I get all the right partitions created and displayed in the gui. If I use a SCSI drive it doesn't work at all. I'm doing all these test on vmware in a virtual machine. Is there a different setup in the kickstart script for IDE and SCSI ? My kickstart script looks like: ..... ..... #Use interactive kickstart installation method interactive #Install OS instead of upgrade install #installation media cdrom #System bootloader configuration bootloader --location=mbr #Clear the Master Boot Record zerombr yes #Partition clearing information clearpart --all --initlabel #Disk partitioning information part /boot --fstype ext3 --size=100 part / --fstype ext3 --size=5000 part /home --fstype ext3 --size=5000 part swap --size=1000 part /extern --fstype ext3 --size 1 --grow ..... ..... From Eric.Lambert at citadelgroup.com Thu Jan 12 15:05:04 2006 From: Eric.Lambert at citadelgroup.com (Lambert, Eric) Date: Thu, 12 Jan 2006 09:05:04 -0600 Subject: partitions on scsi and ide different ? Message-ID: You could try adding the "--ondisk sda" (or what is appropriate) to the end of each partition line. -----Original Message----- From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Ingo Jochim Sent: Thursday, January 12, 2006 9:01 AM To: kickstart-list at redhat.com Subject: partitions on scsi and ide different ? On an interactive installation using an IDE drive I get all the right partitions created and displayed in the gui. If I use a SCSI drive it doesn't work at all. I'm doing all these test on vmware in a virtual machine. Is there a different setup in the kickstart script for IDE and SCSI ? My kickstart script looks like: ..... ..... #Use interactive kickstart installation method interactive #Install OS instead of upgrade install #installation media cdrom #System bootloader configuration bootloader --location=mbr #Clear the Master Boot Record zerombr yes #Partition clearing information clearpart --all --initlabel #Disk partitioning information part /boot --fstype ext3 --size=100 part / --fstype ext3 --size=5000 part /home --fstype ext3 --size=5000 part swap --size=1000 part /extern --fstype ext3 --size 1 --grow ..... ..... _______________________________________________ Kickstart-list mailing list Kickstart-list at redhat.com https://www.redhat.com/mailman/listinfo/kickstart-list From i.jochim at querysoft.de Thu Jan 12 15:23:29 2006 From: i.jochim at querysoft.de (Ingo Jochim) Date: Thu, 12 Jan 2006 16:23:29 +0100 Subject: partitions on scsi and ide different ? In-Reply-To: References: Message-ID: <43C67471.2090203@querysoft.de> That may would work. But I like to have a kickstart CD which works for IDE and SCSI. Ingo Lambert, Eric wrote: >You could try adding the "--ondisk sda" (or what is appropriate) to the >end of each partition line. > >-----Original Message----- >From: kickstart-list-bounces at redhat.com >[mailto:kickstart-list-bounces at redhat.com] On Behalf Of Ingo Jochim >Sent: Thursday, January 12, 2006 9:01 AM >To: kickstart-list at redhat.com >Subject: partitions on scsi and ide different ? > >On an interactive installation using an IDE drive I get all the right >partitions created and displayed in the gui. >If I use a SCSI drive it doesn't work at all. > >I'm doing all these test on vmware in a virtual machine. > >Is there a different setup in the kickstart script for IDE and SCSI ? > >My kickstart script looks like: >..... >..... >#Use interactive kickstart installation method >interactive >#Install OS instead of upgrade >install >#installation media >cdrom > >#System bootloader configuration >bootloader --location=mbr >#Clear the Master Boot Record >zerombr yes > >#Partition clearing information >clearpart --all --initlabel >#Disk partitioning information >part /boot --fstype ext3 --size=100 >part / --fstype ext3 --size=5000 >part /home --fstype ext3 --size=5000 >part swap --size=1000 >part /extern --fstype ext3 --size 1 --grow >..... >..... > > >_______________________________________________ >Kickstart-list mailing list >Kickstart-list at redhat.com >https://www.redhat.com/mailman/listinfo/kickstart-list > >_______________________________________________ >Kickstart-list mailing list >Kickstart-list at redhat.com >https://www.redhat.com/mailman/listinfo/kickstart-list > > > From email at jasonkohles.com Thu Jan 12 16:32:57 2006 From: email at jasonkohles.com (Jason Kohles) Date: Thu, 12 Jan 2006 11:32:57 -0500 Subject: partitions on scsi and ide different ? In-Reply-To: <43C66F3D.7090401@querysoft.de> References: <43C66F3D.7090401@querysoft.de> Message-ID: <87f4e9820601120832h4b454a45h6a9bb56e2e940f76@mail.gmail.com> On 1/12/06, Ingo Jochim wrote: > On an interactive installation using an IDE drive I get all the right > partitions created and displayed in the gui. > If I use a SCSI drive it doesn't work at all. > > I'm doing all these test on vmware in a virtual machine. > > Is there a different setup in the kickstart script for IDE and SCSI ? > > What are you installing? There are no drivers for the SCSI hardware in kernels prior to 2.4.18, so you have to be installing something that has at least that kernel version if you want to use the VMWare SCSI devices. http://www.vmware.com/support/esx2/doc/esx20admin_lsilogic_vms.html -- Jason Kohles email at jasonkohles.com - http://www.jasonkohles.com/ "A witty saying proves nothing." -- Voltaire From gwaugh at frontstreetnetworks.com Thu Jan 12 16:54:03 2006 From: gwaugh at frontstreetnetworks.com (Gerald Waugh) Date: Thu, 12 Jan 2006 10:54:03 -0600 Subject: partitions on scsi and ide different ? In-Reply-To: <43C67471.2090203@querysoft.de> Message-ID: <09e201c61798$d319a960$0301a8c0@Jerrycp> > > That may would work. > But I like to have a kickstart CD which works for IDE and SCSI. Take a look at the ISO that Brian Smith developed for CentOS+BlueQuartz It seems to handle most permutations of a CentOS install. You can get it at; http://www.nuonce.net/bq-cd.php Should give you some ideas... Gerald Waugh Front Street Networks - RaQware http://frontstreetnetworks.com From Gordon.Keegan at FMR.COM Thu Jan 12 17:12:54 2006 From: Gordon.Keegan at FMR.COM (Keegan, Gordon) Date: Thu, 12 Jan 2006 12:12:54 -0500 Subject: partitions on scsi and ide different ? Message-ID: <942A778F73A72141889C1F53A8EAA1C53A5FFE@MSGMMKCLM2WIN.DMN1.FMR.COM> Might be worth verifying that your virtual disk is 11.1gb or larger. I think the default virtual disk size is 4gb. Gordon Keegan -----Original Message----- From: Ingo Jochim [mailto:i.jochim at querysoft.de] Sent: Thursday, January 12, 2006 10:01 AM To: kickstart-list at redhat.com Subject: partitions on scsi and ide different ? On an interactive installation using an IDE drive I get all the right partitions created and displayed in the gui. If I use a SCSI drive it doesn't work at all. I'm doing all these test on vmware in a virtual machine. Is there a different setup in the kickstart script for IDE and SCSI ? My kickstart script looks like: ..... ..... #Use interactive kickstart installation method interactive #Install OS instead of upgrade install #installation media cdrom #System bootloader configuration bootloader --location=mbr #Clear the Master Boot Record zerombr yes #Partition clearing information clearpart --all --initlabel #Disk partitioning information part /boot --fstype ext3 --size=100 part / --fstype ext3 --size=5000 part /home --fstype ext3 --size=5000 part swap --size=1000 part /extern --fstype ext3 --size 1 --grow ..... ..... From chris at instalinux.com Wed Jan 18 19:01:27 2006 From: chris at instalinux.com (chris at instalinux.com) Date: Wed, 18 Jan 2006 11:01:27 -0800 (PST) Subject: (no subject) Message-ID: <3438.69.229.126.186.1137610887.squirrel@webmail.instalinux.com> Hi Folks, I wanted to let everyone know about a new site I've (finally) been able to bring online, that I think may be of interest to those on this list. It lets you click through a series of questions and it generates a Fedora kickstart image that you can burn to a CD. Its based on extensive work that has been done by a group at Hewlett Packard, that has recently been released as an Open Source project called LinuxCOE (on SourceForge here: http://linuxcoe.sourceforge.net). The new site uses that technology to let you create ISO images that you can download and install with. Its running here: http://www.instalinux.com Check it out if you're interested and please send feedback my way, either to this email, or on the forums (http://instalinux.com/forums). Thanks! Chris From MWeiner at ag.com Wed Jan 18 19:05:16 2006 From: MWeiner at ag.com (MW Mike Weiner (5028)) Date: Wed, 18 Jan 2006 14:05:16 -0500 Subject: (no subject) Message-ID: <4FD2C985D5E2A642AE25823DFD61C2B009B3B237@orca.agcom.amgreetings.com> Hi Folks, I wanted to let everyone know about a new site I've (finally) been able to bring online, that I think may be of interest to those on this list. It lets you click through a series of questions and it generates a Fedora kickstart image that you can burn to a CD. Its based on extensive work that has been done by a group at Hewlett Packard, that has recently been released as an Open Source project called LinuxCOE (on SourceForge here: http://linuxcoe.sourceforge.net). The new site uses that technology to let you create ISO images that you can download and install with. Its running here: http://www.instalinux.com Check it out if you're interested and please send feedback my way, either to this email, or on the forums (http://instalinux.com/forums). _______________________________________________ Not to labour the bandwidth, but I just wanted to pop off a THANK YOU note for this post. Michael Weiner From braintunic at gmail.com Wed Jan 25 20:24:22 2006 From: braintunic at gmail.com (braintunic at gmail.com) Date: Wed, 25 Jan 2006 22:24:22 +0200 Subject: kickstart + VNC + virtual terminal Message-ID: <000501c621ed$570021b0$1806000a@exanetil.co.il> Hi, Our kickstart install method (with RHEL3U5) involves running pre-install and post-install scripts using a virtual terminal tty6, as follows: | %pre --interpreter /bin/sh | chvt 6 | bash /mnt/source/install/ks_pre /dev/tty6 2>&1 | chvt 1 | | %post --nochroot --interpreter /bin/sh | chvt 6 | bash /mnt/source/install/ks_post /dev/tty6 2>&1 | chvt 1 Both pre-install and post-install parts are interactive, requesting some data (but continuing on no-input timeout, with a value by default). Everything works OK... Now, I would like to perform a remote installation via VNC. Well, so, I add the "vnc" boot-time option and it begins to work, but... All the time while pre-install runs I see only the "initial" installation screen on my VNC client, I can't see the progress of the pre-install. Then, when the pre-install finishes, I see the nice "Installing Packages" graphical progress on the VNC client. Then, when post-install starts, the picture is stuck and I have no way to see the progress of the post-install. Could anybody suggest a way to get the pre-install and post-install parts available from a VNC client? Any other way to have a completely remote installation with interactive pre-install and post-install parts? Thanks. Bram -------------- next part -------------- An HTML attachment was scrubbed... URL: From phr at doc.ic.ac.uk Wed Jan 25 23:46:26 2006 From: phr at doc.ic.ac.uk (Philip Rowlands) Date: Wed, 25 Jan 2006 23:46:26 +0000 (GMT) Subject: kickstart + VNC + virtual terminal In-Reply-To: <000501c621ed$570021b0$1806000a@exanetil.co.il> References: <000501c621ed$570021b0$1806000a@exanetil.co.il> Message-ID: On Wed, 25 Jan 2006, braintunic at gmail.com wrote: > All the time while pre-install runs I see only the "initial" > installation screen on my VNC client, I can't see the progress of the > pre-install. Then, when the pre-install finishes, I see the nice > "Installing Packages" graphical progress on the VNC client. Then, when > post-install starts, the picture is stuck and I have no way to see the > progress of the post-install. %pre and %post scripts output to VC3, or in your example, VC6. If you need to see them in the GUI, perhaps run an xterm with the right DISPLAY set? Cheers, Phil From smah at vmware.com Tue Jan 31 02:28:50 2006 From: smah at vmware.com (Stephen Mah) Date: Mon, 30 Jan 2006 18:28:50 -0800 Subject: selectively delete partitions Message-ID: <43DECB62.50600@vmware.com> Is there a way to tell anaconda to remove all partitions except for the first partition? Or does anyone have a %pre script that can kill all the partitions except for a partition of a certain type? -thanks steve From vlad.agranovsky at gmail.com Tue Jan 31 10:49:57 2006 From: vlad.agranovsky at gmail.com (vlad.agranovsky at gmail.com) Date: Tue, 31 Jan 2006 12:49:57 +0200 Subject: kickstart + VNC + virtual terminal Message-ID: <000001c62654$153bd970$1806000a@exanetil.co.il> Philip Rowlands wrote: > > | All the time while pre-install runs I see only the "initial" > | installation screen on my VNC client, I can't see the progress of > | the pre-install. Then, when the pre-install finishes, I see the > | nice "Installing Packages" graphical progress on the VNC client. > | Then, when post-install starts, the picture is stuck and I have > | no way to see the progress of the post-install. > > %pre and %post scripts output to VC3, or in your example, VC6. > If you need to see them in the GUI, perhaps run an xterm with > the right DISPLAY set? Well, in my environment xterm doesn't work - it just fails with "segmentation fault". But kterm and rxvt work pretty fine. Something like this: %post --nochroot --interpreter /bin/sh rxvt -fn fixed -geometry 80x40-5-5 -e bash postinstall.sh It will run the postinstall script in a terminal window created directly on the Anaconda mini-wm (i.e., above the graphics installation window). Pay attention that the mini-wm is quite restrictive - it doesn't allow you to resize or move a window, it doesn't allow you to copy-paste text between windows, etc. Another option is to direct rxvt to your "normal" window manager (or maybe to your Xvnc server) using 'rxvt -display'. This way you are not faced with the mini-wm restrictions (but you have to pass your display setting somehow to the installation). Has anybody else implemented a similar configuration? Any more ideas on the item? Thanks. Vlad From rspaulding at mail.arc.nasa.gov Tue Jan 31 16:47:06 2006 From: rspaulding at mail.arc.nasa.gov (Ryan C. Spaulding) Date: Tue, 31 Jan 2006 08:47:06 -0800 Subject: selectively delete partitions In-Reply-To: <43DECB62.50600@vmware.com> References: <43DECB62.50600@vmware.com> Message-ID: Hi Steve, Do you want to re-partition the rest of the disk, or do you just want to reuse the existing partition table? To the best of my knowledge you can only reuse existing partitions. If you want to repartition the disk your best bet is to just dump the data and install and then restore. Thank you, Ryan On Jan 30, 2006, at 6:28 PM, Stephen Mah wrote: > Is there a way to tell anaconda to remove all partitions except for > the first partition? > Or does anyone have a %pre script that can kill all the partitions > except for a partition of a certain type? > > -thanks > steve > > _______________________________________________ > Kickstart-list mailing list > Kickstart-list at redhat.com > https://www.redhat.com/mailman/listinfo/kickstart-list From email at jasonkohles.com Tue Jan 31 16:40:26 2006 From: email at jasonkohles.com (Jason Kohles) Date: Tue, 31 Jan 2006 11:40:26 -0500 Subject: selectively delete partitions In-Reply-To: <43DECB62.50600@vmware.com> References: <43DECB62.50600@vmware.com> Message-ID: <87f4e9820601310840l70fb5b2g49274200fd885e19@mail.gmail.com> On 1/30/06, Stephen Mah wrote: > Is there a way to tell anaconda to remove all partitions except for the > first partition? > Or does anyone have a %pre script that can kill all the partitions > except for a partition of a certain type? > I've used sfdisk to do this in the past, if you want to keep only the first partition, you can do something like this in a %pre: sfdisk -d /dev/sda > /tmp/sfdisk.sda egrep '^(unit|/dev/sda1 )' /tmp/sfdisk.sda | sfdisk Note that in this example there is a space after sda1, which may be important if you have a lot of partitions and don't want it to keep sda10 or sda11 for example. You can also replace the egrep with whatever you want to do to keep the correct partitions. For example, if you want to just keep the Linux partitions (type 83), you could do this: (egrep '^units' /tmp/sfdisk.sda; egrep 'ID=( 5|83)' /tmp/sfdisk.sda) | sfdisk You may or may not need the 5 (the extended partition) depending on your requirements. I've also setup systems to keep the first linux partition and the first swap partition like this: %pre sfdisk -d /dev/sda > /tmp/sfdisk.sda ( head -3 /tmp/sfdisk.sda ( grep Id=82 /tmp/sfdisk.sda | head -1 grep Id=83 /tmp/sfdisk.sda | head -1 ) | sort ) | sfdisk (These systems didn't have anything I wanted to keep on the extended partition, so keep that in mind.) -- Jason Kohles email at jasonkohles.com - http://www.jasonkohles.com/ "A witty saying proves nothing." -- Voltaire From smah at vmware.com Tue Jan 31 17:05:59 2006 From: smah at vmware.com (Stephen Mah) Date: Tue, 31 Jan 2006 09:05:59 -0800 Subject: selectively delete partitions In-Reply-To: <87f4e9820601310840l70fb5b2g49274200fd885e19@mail.gmail.com> References: <43DECB62.50600@vmware.com> <87f4e9820601310840l70fb5b2g49274200fd885e19@mail.gmail.com> Message-ID: <43DF98F7.3000005@vmware.com> >I've used sfdisk to do this in the past, if you want to keep only the >first partition, you can do something like this in a %pre: > >sfdisk -d /dev/sda > /tmp/sfdisk.sda >egrep '^(unit|/dev/sda1 )' /tmp/sfdisk.sda | sfdisk > >Note that in this example there is a space after sda1, which may be >important if you have a lot of partitions and don't want it to keep >sda10 or sda11 for example. You can also replace the egrep with >whatever you want to do to keep the correct partitions. For example, >if you want to just keep the Linux partitions (type 83), you could do >this: > >(egrep '^units' /tmp/sfdisk.sda; egrep 'ID=( 5|83)' /tmp/sfdisk.sda) | sfdisk > >You may or may not need the 5 (the extended partition) depending on >your requirements. > >I've also setup systems to keep the first linux partition and the >first swap partition like this: > >%pre >sfdisk -d /dev/sda > /tmp/sfdisk.sda >( > head -3 /tmp/sfdisk.sda > ( > grep Id=82 /tmp/sfdisk.sda | head -1 > grep Id=83 /tmp/sfdisk.sda | head -1 > ) | sort >) | sfdisk > >(These systems didn't have anything I wanted to keep on the extended >partition, so keep that in mind.) > > thank you, I'll try that later. That's exactly what I was looking for. -steve From rh-kickstart at matthouse.com Tue Jan 31 18:08:06 2006 From: rh-kickstart at matthouse.com (Matt Sturtz) Date: Tue, 31 Jan 2006 11:08:06 -0700 (MST) Subject: selectively delete partitions Message-ID: <3932.64.207.49.98.1138730886.squirrel@www.ontheside.net> Hi Steve, et al-- > Is there a way to tell anaconda to remove all partitions except for the > first partition? Or does anyone have a %pre script that can kill all the > partitions except for a partition of a certain type? I have a Kickstart that is used for brand new Dell systems -- based on your issue, I suspect you're doing something similar. The issue I have is that Dell servers come with a Dell Utility partition (shows in fdisk as partition type DE, but it's really just a FAT16) that is set as bootable from the factory. Part of the "un-seal" process when the machine is first booted is to change the bootable flag to the _next_ partition, which would fail on servers ordered without an OS if there wasn't a second tiny FAT16 partition immediatly following. When this second partition is booted, it shows the "NO OS INSTALLED -- please use the Dell CD's to install Linux the way Dell wants it installed" (who does that?!?!?). You can find more information on this process (as well as the new "Dell PC Restore" stuff) at this site: ... I wanted to keep only the DE partition, and delete the FAT16 partition. if [ "`fdisk -l /dev/sda |grep FAT16`" ] then partid=`fdisk -l /dev/sda |grep FAT16 |cut -f1 -d' ' |cut -f2 -da` echo -n "d $partid w" |fdisk /dev/sda fi This assumes you have a SCSI hard disk, use /dev/hda instead if IDE... This checks to see if there is a FAT16 partition, and if so it gets the partition ID (1-4) and pipes commands through the fdisk program to delete it. This leaves the Dell Utility partition intact. There may be other ways to do the same thing, but this is what I use... Note that, for this to work, you must be careful using the "clearpart" command in your KS.CFG. The "--initlabel" switch creates a brand new partition table (for brand new hard disks), and the "--all" switch will clear all partitions (both do the same thing -- remove the partition you don't want removed).. On my system, I use the "--linux" switch, which will delete only the Linux partitions, leaving my Dell Utility partition alone. Hope this helps, -Matt-