Differences between revisions 8 and 9
Revision 8 as of 2009-12-18 17:07:58
Size: 7505
Editor: FrBrGeorge
Comment:
Revision 9 as of 2009-12-18 17:19:37
Size: 7590
Editor: FrBrGeorge
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
## ЗАнимательная часть
== Постановка задачи ==

Сетевая установка и сетевая загрузка

Постановка задачи

**
**

**
**

**
**

**
**

**
**

**
**

**
**

**
**

**
**

**
**

**
**

**
**

**
**

**
**

**
**

**
**

**
**


Загрузка с LiveCD на сервере

[root@localhost ~]# cat /etc/fstab
proc            /proc                   proc    nosuid,noexec,gid=proc          0 0
devpts          /dev/pts                devpts  nosuid,noexec,gid=tty,mode=620  0 0
tmpfs           /tmp                    tmpfs   nosuid                          0 0
/dev/root / auto  defaults,ro 0 0
UUID=b391cc0a-59c0-4313-b6f2-31f9096b6ba4       swap    swap    defaults        0      0
UUID=e40fc352-f031-4827-ab7c-a7ebe12ecc5e       /mnt/hda2       ext3    noauto  0      0
UUID=2a86bf2b-5d8c-4c04-9acf-0f47448ea45c       /mnt/hda5       ext3    noauto  0      0
UUID=a12e05b3-671f-4914-9d5e-f07cefd2570c       /mnt/hda6       ext3    noauto  0      0

[root@localhost ~]# mount /mnt/hda5
[root@localhost ~]# ls /mnt/hda5/
adm           avahi  empty  local  lost+found  nobody    resolv  srv  yp
aquota.group  cache  ftp    lock   mail        opt       run     tmp
aquota.user   db     lib    log    nis         preserve  spool   www

[root@localhost ~]# mount -t squashfs -o loop /image/live /mnt/hda2
[root@localhost ~]# cp -a /mnt/hda2 /mnt/hda5/srv/public/netinst

[root@localhost ~]# mkdir /mnt/hda5/srv/public/netinst/livefs
[root@localhost ~]# cd /image
[root@localhost image]# cp -a .??* [^l]* lic* /mnt/hda5/srv/public/netinst/livefs/

Настройка сервера

[root@host-15 ~]# diff -u /srv/public/netinst/livefs/live/etc/init.d/livecd-fstab{.orig,}
--- /srv/public/netinst/livefs/live/etc/init.d/livecd-fstab.orig        2009-12-17 21:52:20 +0300
+++ /srv/public/netinst/livefs/live/etc/init.d/livecd-fstab     2009-12-17 21:52:51 +0300
@@ -16,9 +16,9 @@
 MNT_PREFIX="/mnt"
 FSTAB="/etc/fstab"
 UDEVADM="/sbin/udevadm"
-MOUNT_OPTIONS_VFAT="users,noatime,codepage=866,shortname=winnt,iocharset=utf8,gid=0100,fmask=111,dmask=0000"
-MOUNT_OPTIONS_NTFS3G="users,locale=ru_RU.utf8,gid=100,fmask=111,force,dmask=000" # force
-MOUNT_OPTIONS_OTHER="noauto"
+MOUNT_OPTIONS_VFAT="users,ro,noatime,codepage=866,shortname=winnt,iocharset=utf8,gid=0100,fmask=111,dmask=0000"
+MOUNT_OPTIONS_NTFS3G="users,ro,locale=ru_RU.utf8,gid=100,fmask=111,force,dmask=000" # force
+MOUNT_OPTIONS_OTHER="noauto,ro"
 
 log() {
     initlog $INITLOG_ARGS -n $0 -s "$1"

[root@host-15 ~]# service nfs restart
Stopping NFS mount service: [ DONE ]
Stopping NFS daemon: [ DONE ]
Stopping NFS svcgssd service: [ DONE ]
Stopping NFS quotas service: [ DONE ]
Unexporting NFS file systems: [ DONE ]
Exporting NFS file systems: [ DONE ]
Starting NFS quotas service: [ DONE ]
Starting NFS svcgssd service: [ DONE ]
Starting NFS daemon: [ DONE ]
Starting NFS mount service: [ DONE ]
Stopping rpc.idmapd service: [ DONE ]
Starting rpc.idmapd service: [ DONE ]

[root@host-15 ~]# cd /srv/public/netinst/
[root@host-15 netinst]# mv hda2 livefs/live
[root@host-15 netinst]# chmod 755 hda2/

[root@host-15 ~]# cat  /var/lib/tftpboot/pxelinux.cfg/default.orig 
default linux
prompt 1
timeout 100
gfxboot syslinux/bootlogo
display syslinux/boot.msg
implicit 1

label harddisk
  localboot 0x80

label linux
  kernel syslinux/alt0/vmlinuz
    append initrd=syslinux/alt0/full.cz changedisk ramdisk_size=65536 lang=ru_RU vga=0x314 splash=silent splashcount=17 xdriver=auto showopts automatic=method:nfs,network:dhcp tz=Europe/Moscow

 . . .

label live
  kernel syslinux/alt0/vmlinuz
  append initrd=syslinux/alt0/full.cz live fastboot vga=0x314 splash=silent splashcount=17 stagename=live showopts automatic=method:nfs,network:dhcp tz=Europe/Moscow

[root@host-15 ~]# cat  /var/lib/tftpboot/pxelinux.cfg/default
default live
prompt 0
timeout 0
noescape 1

label live
  kernel syslinux/alt0/vmlinuz
  append initrd=syslinux/alt0/full.cz live fastboot lang=ru_RU vga=0x314 splash=silent splashcount=17 stagename=live showopts automatic=method:nfs,network:dhcp tz=Europe/Moscow

[root@host-15 ~]# ln -sf livefs /srv/public/netinst/current
[root@host-15 ~]# l /srv/public/netinst/
total 2630452
drwxr-xr-x 5 root _ahttpd       4096 Dec 18 15:45 ./
lrwxrwxrwx 1 root root             6 Dec 18 15:45 current -> livefs/
drwxr-xr-x 8 root root          4096 Dec 17 21:01 livefs/
drwxr-xr-x 3 root root          4096 Dec 17 21:00 ../
drwxr-xr-x 2 root root          4096 Dec 17 20:35 mnt/
drwxr-xr-x 2 root _ahttpd       4096 Dec 17 20:35 download/
-rw-r--r-- 1 root root            67 Dec 17 20:34 list
-rw-r--r-- 1 root root    2690922496 Dec 17 20:34 1.img

Настройка файловой системы клиента

[root@host-15 ~]# chroot /srv/public/netinst/livefs/live/
[root@host-15 /]# cat > /etc/rc.d/rc.local
#!/bin/sh
dhcpcd -p eth0
^D
[root@host-15 /]# chmod +x /etc/rc.d/rc.local
[root@host-15 /]# { echo "P@sSw0RD" ; echo "P@sSw0RD" ; } | passwd --stdin root

[root@host-15 ~]# diff -u /srv/public/netinst/livefs/live/etc/init.d/livecd-save-nfs{.orig,}
--- /srv/public/netinst/livefs/live/etc/init.d/livecd-save-nfs.orig     2009-12-18 15:39:55 +0300
+++ /srv/public/netinst/livefs/live/etc/init.d/livecd-save-nfs  2009-12-18 15:39:57 +0300
@@ -16,6 +16,7 @@
 {
         if ip -o a | grep -q 'eth.*UP' ; then 
                 iface=$(ip -o a | grep 'eth.*UP' | cut -f 2 -d' ' | tr -d ':')
+                ls /etc/net/ifaces > /dev/null
                 mkdir -p /etc/net/ifaces/$iface
                 echo 'NM_CONTROLLED=no' >> /etc/net/ifaces/$iface/options
                 echo 'BOOTPROTO=dhcp' >> /etc/net/ifaces/$iface/options


LiveCD по сети:

  • Загрузиться с Livecd на сервере
  • смонтировать /image/live на /mnt/sda2
  • смонтировать /mnt/sda5
  • скопировать /mnt/sda2 на /mnt/sda5/srv/public/netinst
  • загрузить сервер
  • создать /srv/public/netinst/livefs
  • скопировать /srv/public/netinst/mnt/* (всё, кроме live и ALTLinux) на /srv/public/netinst/livefs
  • mv /srv/public/netinst/sda2 /srv/public/netinst/livefs/live
  • chroot /srv/public/netinst/livefs
    • chkconfig chkconfig livecd-save-nfs off
    • NM_CONTROLLED=no в /etc/net/ifaces/default/options
    • echo "#!/bin/sh\ndhcpcd eth0" > /etc/rc/rc.local; chmod +x /etc/rc/rc.local

    • установить пароль оута
    • убрать монтирование левых разделов
  • ln -sf livefs current

FrBrGeorge/BookP5/NetworkInstall (last edited 2010-02-16 17:53:32 by FrBrGeorge)