Re: Customized Remote Install

2009-04-22 Thread Jorg Andersson

Can you explain in more detail how to make a CD boot up FreeBSD and run a
script? I haven't find any good resource on google. Alternatively, if you
can provide a link.
-- 
View this message in context: 
http://www.nabble.com/Customized-Remote-Install-tp23165397p23171529.html
Sent from the freebsd-questions mailing list archive at Nabble.com.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Customized Remote Install

2009-04-22 Thread Odhiambo ワシントン
On Tue, Apr 21, 2009 at 11:42 PM, Scott Seekamp sseek...@risei.net wrote:

 I've done a lot of searching and maybe this capability doesn't exist, but I
 am looking to do this:

 I am at my company's HQ, we have a new field office that I am setting up a
 FreeBSD server. The technical knowledge at the site windows only, so I
 basically have someone I can have put a CD in a drive and power a machine
 on.

 My problem is that the default install of FreeBSD has password
 authentication turned off, and root SSH disabled. Being a small office, they
 don't have a IP KVM or some way for me to get to the box to configure it.

 My hope was that I could make an automated install CD/DVD that configured
 all the options I want AND change some base config files so I can actually
 get to the box (or install an SSH key).

 I know I can do the scripted sysinstall, but from what I could find I would
 need a floppy or additional CD to put the answer file on.

 I'm open to other options if someone has gone down this road before!


All you need is that the guy at the field office knows something about PC
hardware and can type a few commands on any command line. Then there should
be a phone.
FreeBSD is not as silly as Linux when you move a disk from one box to
another. If it is a server box (which requires no GUI) then the only
changes you are likely to make are on the network configurations (ifconfig_*
in rc.conf and resolv.conf) and the rest will remain pretty much the same.

What I have done is that I have a prototype, which is a SATA disk. I am
pretty much okay of the next machine I want to install has a SATA disk, but
I am also not worried if it has PATA disk as I know I will only need a
change in /etc/fstab.
So what I normally do is this:

Attach my prototype disk as master on the machine to install, while slaving
the disk that the machine  had.
I enter sysinstall and disklable/newfs the slave disk. I make the disk
bootable, enable softupdates on it and I normally create the root mount
point (/). Once done, I change the mount point again to, say, /newdisk, so
the slave disk is now mounted on /newdisk.
After this:

dump L0af - / | (cd /newdisk/; restore -rf -) # BTW, I have the habit of
creating only / and swap!

So  now I have a duplicate system on the slave disk.

cd /newdisk; ee etc/rc.conf ; ee etc/fstab; ee etc/resol.conf
Here I change the ifconfig_ line for the network device (as seen from
dmesg.boot), ensure that fstab refers to the correct device names and voila!
I save, shutdown, remove my prototype disk, restore the slave disk to master
position and reboot and I have a system identical to the proto. Once
connected to a live network, I can ssh to it from anywhere I want using my
own account and the su to root if needed, though I always prefer sudo.

Now, if only you can follow my way, you only need to ship your prototype
disk to the field office and get the windows lunnie to do the disk
connections, type the commands, etc and you have a server running at the
field office in no time!
Of course tell him to pack your prototype disk safely and return it to you.


-- 
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254733744121/+254722743223
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Clothes make the man.  Naked people have little or no influence on
society.
  -- Mark Twain
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Customized Remote Install

2009-04-22 Thread Jerry McAllister
On Wed, Apr 22, 2009 at 07:47:43AM +0200, Polytropon wrote:

 On Tue, 21 Apr 2009 18:47:11 -0400, Jerry McAllister jerr...@msu.edu wrote:
  On Tue, Apr 21, 2009 at 11:51:32PM +0200, Polytropon wrote:
  
   On Tue, 21 Apr 2009 14:42:32 -0600, Scott Seekamp sseek...@risei.net 
   wrote:
My hope was that I could make an automated install CD/DVD that  
configured all the options I want AND change some base config files so  
I can actually get to the box (or install an SSH key).
[...]
I'm open to other options if someone has gone down this road before!
   
   I'd like to advertize a method that I think is very comfortable
   in such a setting. It's worth mentioning that this method
   usually requires (a) modern enough PCs or (b) you to know what
   is the hardware profile of the PC.
   
   The method works as follows:
   
   First create a FreeBSD as you want it to be on the clients.
   Install and configure everything as you intend.
   
   Then dump the created partitions onto a CD or DVD and create
   a simple script that:
 1. initializes the client's hard disk
 2. slices the disk and newfses the partitions
 3. dumps the partition images onto the disks
 4. reboots the machine into operating state.
   
   After this, you should be able to SSH into the client and
   change settings that need to be changed.
  
  This works very well. 
 
 I just realize that I missed something: Better than dd, I think
 dump  restore are the preferred tools to create the partition
 images. When you're done on your template system, umount its
 partitions (in SUM) and use dump to dump them into files. These
 files go to the installation DVD and are later on restored onto
 the (empty) partitions using the restore command. This will
 preserve any permissions and other file properties.
 
 
 
   I have done essentially the same many times.
  The one thing missing is that you need to have something to set the
  network information -- hostname, IP address, gateway, netmask
  and name-server.These will be different for each machine.
  So, your script will have to accomodate this - read console
  input for these items and plug them in to the proper places
  before rebooting.
 
 That's correct. I always used a kind of CHANGE THIS! items
 to do so, or, if none are given, they are automatically created
 so the system boots up and runs, but then again, require service
 afterwards. This can be made work this way: When the incomplete
 system is up and running, it mails the distant administrator (or
 contacts him in another way) requiring him to finish the settings.
 But I think it's the best solution to propmt for these
 specific settings at installation time (read, when the
 restore job is done, the partitions can be mounted -o rw and
 the files neccessary to be changed can be created or modified).
 
 The installation will then continue and finish.
 
 Of course, the dump  restore method lacks a lot of bling,
 blitzen, eye candy, bells and whistles, but it honours the
 abstinence to such stuff with speed and easyness of use. But
 it's still neccessary to read (and understand) and press a
 few keys on the keyboard. :-)

the dump/restore method's best and biggest bling and bell and whistle
is that it works correctly and is the most straight forward and easy.

jerry


 
 
 
 -- 
 Polytropon
 From Magdeburg, Germany
 Happy FreeBSD user since 4.0
 Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Customized Remote Install

2009-04-21 Thread Scott Seekamp
I've done a lot of searching and maybe this capability doesn't exist,  
but I am looking to do this:


I am at my company's HQ, we have a new field office that I am setting  
up a FreeBSD server. The technical knowledge at the site windows only,  
so I basically have someone I can have put a CD in a drive and power a  
machine on.


My problem is that the default install of FreeBSD has password  
authentication turned off, and root SSH disabled. Being a small  
office, they don't have a IP KVM or some way for me to get to the box  
to configure it.


My hope was that I could make an automated install CD/DVD that  
configured all the options I want AND change some base config files so  
I can actually get to the box (or install an SSH key).


I know I can do the scripted sysinstall, but from what I could find I  
would need a floppy or additional CD to put the answer file on.


I'm open to other options if someone has gone down this road before!

Thanks!

Scott Seekamp

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Customized Remote Install

2009-04-21 Thread Polytropon
On Tue, 21 Apr 2009 14:42:32 -0600, Scott Seekamp sseek...@risei.net wrote:
 My hope was that I could make an automated install CD/DVD that  
 configured all the options I want AND change some base config files so  
 I can actually get to the box (or install an SSH key).
 [...]
 I'm open to other options if someone has gone down this road before!

I'd like to advertize a method that I think is very comfortable
in such a setting. It's worth mentioning that this method
usually requires (a) modern enough PCs or (b) you to know what
is the hardware profile of the PC.

The method works as follows:

First create a FreeBSD as you want it to be on the clients.
Install and configure everything as you intend.

Then dump the created partitions onto a CD or DVD and create
a simple script that:
1. initializes the client's hard disk
2. slices the disk and newfses the partitions
3. dumps the partition images onto the disks
4. reboots the machine into operating state.

After this, you should be able to SSH into the client and
change settings that need to be changed.

You always have your reference machine at hand, because it's
exactly installed and configured as the clients.

Under controlled conditions, it's even possible to build the
needed system in a virtualized environment.




-- 
Polytropon
From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Customized Remote Install

2009-04-21 Thread Jerry McAllister
On Tue, Apr 21, 2009 at 11:51:32PM +0200, Polytropon wrote:

 On Tue, 21 Apr 2009 14:42:32 -0600, Scott Seekamp sseek...@risei.net wrote:
  My hope was that I could make an automated install CD/DVD that  
  configured all the options I want AND change some base config files so  
  I can actually get to the box (or install an SSH key).
  [...]
  I'm open to other options if someone has gone down this road before!
 
 I'd like to advertize a method that I think is very comfortable
 in such a setting. It's worth mentioning that this method
 usually requires (a) modern enough PCs or (b) you to know what
 is the hardware profile of the PC.
 
 The method works as follows:
 
 First create a FreeBSD as you want it to be on the clients.
 Install and configure everything as you intend.
 
 Then dump the created partitions onto a CD or DVD and create
 a simple script that:
   1. initializes the client's hard disk
   2. slices the disk and newfses the partitions
   3. dumps the partition images onto the disks
   4. reboots the machine into operating state.
 
 After this, you should be able to SSH into the client and
 change settings that need to be changed.

This works very well.   I have done essentially the same many times.
The one thing missing is that you need to have something to set the
network information -- hostname, IP address, gateway, netmask
and name-server.These will be different for each machine.
So, your script will have to accomodate this - read console
input for these items and plug them in to the proper places
before rebooting.

jerry


 
 You always have your reference machine at hand, because it's
 exactly installed and configured as the clients.
 
 Under controlled conditions, it's even possible to build the
 needed system in a virtualized environment.
 
 
 
 
 -- 
 Polytropon
 From Magdeburg, Germany
 Happy FreeBSD user since 4.0
 Andra moi ennepe, Mousa, ...
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Customized Remote Install

2009-04-21 Thread Polytropon
On Tue, 21 Apr 2009 18:47:11 -0400, Jerry McAllister jerr...@msu.edu wrote:
 On Tue, Apr 21, 2009 at 11:51:32PM +0200, Polytropon wrote:
 
  On Tue, 21 Apr 2009 14:42:32 -0600, Scott Seekamp sseek...@risei.net 
  wrote:
   My hope was that I could make an automated install CD/DVD that  
   configured all the options I want AND change some base config files so  
   I can actually get to the box (or install an SSH key).
   [...]
   I'm open to other options if someone has gone down this road before!
  
  I'd like to advertize a method that I think is very comfortable
  in such a setting. It's worth mentioning that this method
  usually requires (a) modern enough PCs or (b) you to know what
  is the hardware profile of the PC.
  
  The method works as follows:
  
  First create a FreeBSD as you want it to be on the clients.
  Install and configure everything as you intend.
  
  Then dump the created partitions onto a CD or DVD and create
  a simple script that:
  1. initializes the client's hard disk
  2. slices the disk and newfses the partitions
  3. dumps the partition images onto the disks
  4. reboots the machine into operating state.
  
  After this, you should be able to SSH into the client and
  change settings that need to be changed.
 
 This works very well. 

I just realize that I missed something: Better than dd, I think
dump  restore are the preferred tools to create the partition
images. When you're done on your template system, umount its
partitions (in SUM) and use dump to dump them into files. These
files go to the installation DVD and are later on restored onto
the (empty) partitions using the restore command. This will
preserve any permissions and other file properties.



  I have done essentially the same many times.
 The one thing missing is that you need to have something to set the
 network information -- hostname, IP address, gateway, netmask
 and name-server.These will be different for each machine.
 So, your script will have to accomodate this - read console
 input for these items and plug them in to the proper places
 before rebooting.

That's correct. I always used a kind of CHANGE THIS! items
to do so, or, if none are given, they are automatically created
so the system boots up and runs, but then again, require service
afterwards. This can be made work this way: When the incomplete
system is up and running, it mails the distant administrator (or
contacts him in another way) requiring him to finish the settings.
But I think it's the best solution to propmt for these
specific settings at installation time (read, when the
restore job is done, the partitions can be mounted -o rw and
the files neccessary to be changed can be created or modified).

The installation will then continue and finish.

Of course, the dump  restore method lacks a lot of bling,
blitzen, eye candy, bells and whistles, but it honours the
abstinence to such stuff with speed and easyness of use. But
it's still neccessary to read (and understand) and press a
few keys on the keyboard. :-)



-- 
Polytropon
From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org