GRUBが壊れたときは systemrescue CD で
chroot してなおします。
私は swap と / だけなので (つまり bootのためにパーティションをとってない )
http://www.sysresccd.org/Sysresccd-Partitioning-EN-Repairing-a-damaged-Grub
の
root@sysresccd /root % mkdir /mnt/linux
root@sysresccd /root % mount /dev/sda2 /mnt/linux
root@sysresccd /root % mount -o bind /proc /mnt/linux/proc
root@sysresccd /root % mount -o bind /dev /mnt/linux/dev
root@sysresccd /root % mount -o bind /sys /mnt/linux/sys
chroot /mnt/linux /bin/bash
grub-install /dev/sda
で復活できます。
thin client は
thin server さえあれば、 HDD、 CDドライブ、 USB がなくとも
ネットから立ち上がっていきます。
以下によくまとめられてまして

、 これに一部改良を加えたものを出発点として
このページの後ろの方に
edubuntu そして ubuntu における ltsp を書きました。 でも以下のがすごくよくまとまってますので一読されてはどうでしょうか。
http://chschneider.eu/linux/server/ltsp-server.shtml
まず 上をほぼ丸写しで sqeezeでやりました。
これを 現在風にアレンジしました。
たとえば
くるのは dhcp3-server ではなく
isc-dhcp-serverなのですから。
自分が理解したのを 解説すると
internet router
DHCPD
192.168.1.1
|
|
|
HUB---------------------dhcp(by thin server)
debian thin client
|
|
|
eth0 192.168.1.201
DHCPD
debian thin server
です。
apt-get update
apt-get install
nfs-kernel-server
apt-get install ltsp-server
apt-get install
isc-dhcp-server
debian thin serverでは、完成するまでは
DHCPD
を動かないようにしておきます。
つまり/etc/init.d/isc-dhcp-server stop
ですね。
cat /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.201
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 192.168.1.1
#dns-search home
cat /etc/dhcp/dhcpd.conf
authoritative;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.202 192.168.1.203;
option domain-name "lan";
option domain-name-servers 192.168.1.201;
option broadcast-address 192.168.1.255;
option routers 192.168.1.201;
next-server 192.168.1.201;
# get-lease-hostnames true;
option subnet-mask 255.255.255.0;
option root-path "/opt/ltsp/i386";
if substring( option vendor-class-identifier, 0, 9 ) = "PXEClient" {
filename "/ltsp/i386/pxelinux.0";
} else {
filename "/ltsp/i386/nbi.img";
}
}
cat /etc/exports
/opt/ltsp *(ro,no_root_squash,async,no_subtree_check)
そして
# ltsp-build-client --arch i386 \
--mirror http://ftp.de.debian.org/debian/ \
--security-mirror http://ftp.de.debian.org/debian-security/
は、
# ltsp-build-client --arch i386 \
--mirror http://ftp.jp.debian.org/debian/ \
--security-mirror http://ftp.jp.debian.org/debian-security/
でいいはずですが、 jp は 2014・9・4時点ではだめでした、
なぜなんでしょう。
chroot /opt/ltsp/i386/
apt-get u
pdate && apt-get upgrade
exit
After kernel updates in the client system, the versions delivered by the
TFTP server must also be replaced. Just run:
これでできあがってます。
あとは
debian thin server
を再起動
し
cat thin.bat
/etc/init.d/isc-dhcp-server restart
/etc/init.d/tftpd-hpa restart
echo
echo
echo
ps ax| grep dhcp
echo
echo
echo
ps ax| grep tftp
echo
echo
echo
ps ax| grep nf
するだけです。
ところで
debian thin client を ネットワーク boot すると
おもいきり文字化けした画面がでてきます(10行後にこの対策を書いてます)。
ここで 最初の空欄に thin server でのID
次の空欄に そのpasswd
それから 左の 文字化けをクリックすると みなれたdebianの画面がきます。
文字化けは 次の方法で解決します。
cat /opt/ltsp/i386/etc/lts.conf
[default]
LTSP_CONFIG=True
#SOUND=False
#LOCALDEV=False
#CONFIGURE_X=False
LANG=en_US.UTF-8
# LANGUAGE=ja_JP.UTF-8
# LDM_LANGUAGE=ja_JP.UTF-8
と赤字の1行を加えると login画面のみが英語となってわかりやすくなります。
おかしいことは
debian thin client で rootでhalt すると、 client の画面を残したままserver がshutdown します。もっともこれは rootのpasswd知らないとできないことです。それから
debian thin serverをgnomeから lxdeにすると debian thin client でも
同じlxdeになります.
( fluxbox は相性が悪い )。
またもちろん clientの HDDを退けても 立ち上がってきます。
ということは CDがなくとも USB、HDDがいかれても NICとMEMORYさえあれば 動きます。
でも thin client 導入は
edbuntu を使う方がもっと簡単でも 重い。
ここでは
cat /etc/exports
cat: /etc/exports: そのようなファイルやディレクトリはありません
root@eTHIN:/home/tuyosi# dpkg -l | grep nf
はいってないのです。
どうなってるんでしょう。
それは
The NBD protocol allows a block device (or an image of a block device)
to be exported from one machine to another.
Typically the it would then be mounted as a filesystem or used as a swap area.
Exported devices are
identified by the IP address and TCP port number from which they are hosted.
らしい。
さて 最後が ubuntuで thin-client です。
Ubuntu 14.04 i386 です。
wifi router
DHCPD
192.168.100.254
|
wireless
|
wifi dhcp
ubuntu thin server
192.168.1.201
|
HUB
|
thin client
まず あとで 述べる ltsp-build-client をやりなおさないために
aptitude update
をしておいてください
cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto eth2
iface eth2 inet static
address 192.168.1.201
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
# gateway 192.168.1.1
dns-nameservers 192.168.100.254
cat /etc/exports
/opt/ltsp *(ro,no_root_squash,async,no_subtree_check)
cat /etc/dhcp/dhcpd.conf
authoritative;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.202 192.168.1.203;
option domain-name "ubuntu-thin";
# option domain-name-servers 192.168.1.201;
option domain-name-servers 192.168.100.254;
option broadcast-address 192.168.1.255;
option routers 192.168.1.201;
next-server 192.168.1.201;
option subnet-mask 255.255.255.0;
option root-path "/opt/ltsp/i386";
if substring( option vendor-class-identifier, 0, 9 ) = "PXEClient" {
filename "/ltsp/i386/pxelinux.0";
} else {
filename "/ltsp/i386/nbi.img";
}
}
cat /etc/default/isc-dhcp-server
INTERFACES="eth2"
apt-get install
nfs-kernel-server
apt-get install ltsp-server
apt-get install
isc-dhcp-server
ltsp-build-client --arch i386
chroot /opt/ltsp/i386/
apt-get u
pdate && apt-get upgrade
exit
After kernel updates in the client system, the versions delivered by the
TFTP server must also be replaced. Just run:
関係ないですが
ltsp-update-image ltsp-update-kernels ltsp-update-sshkeys
などもあります。
あとは
cat thin.bat
/etc/init.d/nfs-kernel-server restart
/etc/init.d/isc-dhcp-server restart
/etc/init.d/tftpd-hpa restart
echo
echo
echo
ps ax| grep dhcp
echo
echo
echo
ps ax| grep tftp
echo
echo
echo
ps ax| grep nf
これで再起動しなくても動いてます。
このあとubuntを軽くするために
aptitude install gnome (保険)
aptitude install lxde (主に使う)
aptitude remove unity compiz
をしておきます。
thin client を ネットワーク boot すると ubntuでは
文字化けしない画面がでてきます。
そして 最終的には持ち運びがいいように
HDDのubuntuを USBメモリに
(cd /mnt0; tar cvpf - .)|(cd /mnt1 ; tar xpf -)
なんかして写します。
USBで/etc/fstab の手直しも必要です。
blkid /dev/sdb1 なんかして
cat /etc/fstab
UUID=4db436dd-626b-4a85-aa86-aa115ada9ac7 / ext4 errors=remount-ro 0 1
UUID=06b169e7-9004-4569-9a4b-5f5145025bb7 none swap sw 0 0
それから ネットワーク関係にHDDのが残ってるので これをUSB用に修正します。
cat /etc/udev/rules.d/70-persistent-net.rules <ー元
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x8086:0x1229 (e100)
SUBSYSTEM=="net",
ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:a0:c9:27:dc:91",
ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x1013 (e1000)
SUBSYSTEM=="net",
ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:81:2a:bd:0f",
ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x8086:0x1229 (e100)
SUBSYSTEM=="net",
ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:a0:c9:6d:3f:83",
ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# USB device 0x:0x (rt2800usb)
SUBSYSTEM=="net",
ACTION=="add", DRIVERS=="?*", ATTR{address}=="dc:fb:02:58:a7:cd",
ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
# USB device 0x:0x (rtl8192cu)
SUBSYSTEM=="net",
ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:22:cf:ec:c8:05",
ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan1"
# USB device 0x:0x (rt73usb)
SUBSYSTEM=="net",
ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:22:cf:01:22:6f",
ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan2"
# PCI device 0x14e4:0x1713 (tg3)
SUBSYSTEM=="net",
ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1e:c9:05:78:fc",
ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
# USB device 0x:0x (asix)
SUBSYSTEM=="net",
ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0d:0b:6a:34:16",
ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"
を
cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# USB device 0x:0x (rt2800usb)
SUBSYSTEM=="net",
ACTION=="add", DRIVERS=="?*", ATTR{address}=="dc:fb:02:58:a7:cd",
ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
# PCI device 0x14e4:0x1713 (tg3)
SUBSYSTEM=="net",
ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1e:c9:05:78:fc",
ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
にし
/etc/network/interfaces
/etc/default/isc-dhcp-server
のeth3 を eth0 にします。
これで HDDからUSDへの移行は終わりです。
このブログもこのUSBから起動したubuntuで書いてます。
なお USBの grub.cfg は以下です。
.........
menuentry 'Ubuntu'
--class ubuntu --class gnu-linux --class gnu --class os
$menuentry_id_option
'gnulinux-simple-4db436dd-626b-4a85-aa86-aa115ada9ac7' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1
--hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1
4db436dd-626b-4a85-aa86-aa115ada9ac7
else
search --no-floppy --fs-uuid --set=root 4db436dd-626b-4a85-aa86-aa115ada9ac7
fi
linux /boot/vmlinuz-3.13.0-35-generic root=UUID=4db436dd-626b-4a85-aa86-aa115ada9ac7 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.13.0-35-generic
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-4db436dd-626b-4a85-aa86-aa115ada9ac7' {
menuentry 'Ubuntu, with Linux 3.13.0-35-generic' --class ubuntu --class
gnu-linux --class gnu --class os $menuentry_id_option
'gnulinux-3.13.0-35-generic-advanced-4db436dd-626b-4a85-aa86-aa115ada9ac7'
{
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1
--hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1
4db436dd-626b-4a85-aa86-aa115ada9ac7
else
search --no-floppy --fs-uuid --set=root 4db436dd-626b-4a85-aa86-aa115ada9ac7
fi
echo 'Linux 3.13.0-35-generic をロード中...'
linux /boot/vmlinuz-3.13.0-35-generic root=UUID=4db436dd-626b-4a85-aa86-aa115ada9ac7 ro quiet splash $vt_handoff
echo '初期 RAM ディスクをロード中...'
initrd /boot/initrd.img-3.13.0-35-generic
}
menuentry
'Ubuntu, with Linux 3.13.0-35-generic (recovery mode)' --class ubuntu
--class gnu-linux --class gnu --class os $menuentry_id_option
'gnulinux-3.13.0-35-generic-recovery-4db436dd-626b-4a85-aa86-aa115ada9ac7'
{
recordfail
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1
--hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1
4db436dd-626b-4a85-aa86-aa115ada9ac7
else
search --no-floppy --fs-uuid --set=root 4db436dd-626b-4a85-aa86-aa115ada9ac7
fi
echo 'Linux 3.13.0-35-generic をロード中...'
linux /boot/vmlinuz-3.13.0-35-generic root=UUID=4db436dd-626b-4a85-aa86-aa115ada9ac7 ro recovery nomodeset
echo '初期 RAM ディスクをロード中...'
initrd /boot/initrd.img-3.13.0-35-generic
}
menuentry
'Ubuntu, with Linux 3.13.0-24-generic' --class ubuntu --class gnu-linux
--class gnu --class os $menuentry_id_option
'gnulinux-3.13.0-24-generic-advanced-4db436dd-626b-4a85-aa86-aa115ada9ac7'
{
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1
--hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1
4db436dd-626b-4a85-aa86-aa115ada9ac7
else
search --no-floppy --fs-uuid --set=root 4db436dd-626b-4a85-aa86-aa115ada9ac7
fi
echo 'Linux 3.13.0-24-generic をロード中...'
linux /boot/vmlinuz-3.13.0-24-generic root=UUID=4db436dd-626b-4a85-aa86-aa115ada9ac7 ro quiet splash $vt_handoff
echo '初期 RAM ディスクをロード中...'
initrd /boot/initrd.img-3.13.0-24-generic
}
menuentry
'Ubuntu, with Linux 3.13.0-24-generic (recovery mode)' --class ubuntu
--class gnu-linux --class gnu --class os $menuentry_id_option
'gnulinux-3.13.0-24-generic-recovery-4db436dd-626b-4a85-aa86-aa115ada9ac7'
{
recordfail
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1
--hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1
4db436dd-626b-4a85-aa86-aa115ada9ac7
else
search --no-floppy --fs-uuid --set=root 4db436dd-626b-4a85-aa86-aa115ada9ac7
fi
echo 'Linux 3.13.0-24-generic をロード中...'
linux /boot/vmlinuz-3.13.0-24-generic root=UUID=4db436dd-626b-4a85-aa86-aa115ada9ac7 ro recovery nomodeset
echo '初期 RAM ディスクをロード中...'
initrd /boot/initrd.img-3.13.0-24-generic
}
}
mintは ltsp うまくいかない。
やってみると lxdeにした ubuntuを使うのがお手軽かと思う。
apt-get install libdvdread4
/usr/share/doc/libdvdread4/install-css.sh
で
libdvdcss も入る。
root (hd0,4)
kernel /vmlinuz root=/dev/sda5 ro
initrd /initrd.img
話がかわります。
ltsp サーバーの使い回しです。
ubuntuをUSBメモリにいれて ltsp サーバーをたちあげてます。
ところが ubuntuは デフォルトのカーネルはpentium以上です。
これではとても 古いCPUのPCでは thin clientが立ち上がりません。
かといって 容量の小さいUSBの上でkernel を作りなおすことはちょっと無理です。
で ltsp サーバーを他所から借りてきます。
つまり HDDにあるdebian の [/opt] と [/srv/tftp/ltsp]とを
ubuntuのにコーピーします。
(元のはそれぞれ名前を変えておく)
@uTHIIN:~$ ls /opt*
/opt:
ltsp
/opt-ubuntu:
ltsp
@uTHIIN:~$ ls /var/lib/tftpboot/
ltsp ltsp-ubuntu
すると 古いPCで thin clientが立ち上がります。
ただし 借り物のltsp サーバーですので lisp-update-imageなんかすると
古いCPUを受け付けなくなりますので注意。
おそらく何か 例えば lisp-update-image したかったらもとのdebian でやるべきと思います
lxdeの導入は ubuntuでやっても大丈夫でした。
gnomeも 元のdebianのではなく ubuntuのそれでした。
何か 分業をしてる雰囲気。
不思議なことは たちあがったあと uname -ar すると ubuntuのになってます。
つまり たちがる前は 母国語での準備がいるけど 立ち上がったらltspサーバー のつまり外国語で話せるっていうことかな?さらに 同じ debian の [/opt] と [/srv/tftp/ltsp] (前項でこれ既にUSBに写してました)とを
uefi + secure boot PCで立ち上がってくる LINUX MINTに USBを利用してコピーしました。
すると oldノートPCで thin client がたちあがってきます。
しかし MINTのユーザーでしかログインできません。
この ノートPCと ltsp の相性がいいのか youtubeで音が thin clientで聞こえます。
しかし 別のold oldノートでは音がでません。