Keep Da Link

To content | To menu | To search

Keyword - linux

Entries feed - Comments feed

-->

Aug. 7, 2008

Installation de Gentoo 2008.0 sur une dedibox XL

Dedibox à l'heure actuelle ne fournit qu'une version 2007.0 de Gentoo en 32 bits.
Les core duo 2 sont des cpus 64bits en emulation amd64, voici les étapes à suivre pour installer une 2008.0 en 64bits:

Installer d'abord ubuntu en 64 bits pour avoir un rescue en 64 bits oui c est nul ...
Choisissez un partionnement qui ressemblera à votre future installation cela vous évitera de devoir le refaire à la main.

Une fois l'installation terminé, lancez la console de secours par l'interface dedibox, connectez vous

EDIT: ATTENTION dans mon exemple la swap est sur /dev/sda1 et mon / sur /dev/sda2, rien ne vous oblige à suivre le même partionnement, l'installation est la même que pour gentoo standard, la seule nuance réside dans le fait de faire cela a distance sans live cd, et d'avoir un kernel qui boot correctement.

mkdir /mnt/gentoo
mount /dev/sda2 /mnt/gentoo
cd /mnt/gentoo/
wget ftp://ftp.free.fr/pub/Distributions_Linux/Gentoo/releases/amd64/2008.0/stages/stage3-amd64-2008.0.tar.bz2
tar xvjpf stage3-amd64-2008.0.tar.bz2 
rm stage3-amd64-2008.0.tar.bz2 
wget ftp://ftp.free.fr/pub/Distributions_Linux/Gentoo/snapshots/portage-20080806.tar.bz2
tar xvjf portage-20080806.tar.bz2 -C /mnt/gentoo/usr

Editez /mnt/gentoo/etc/make.conf pour y faire figurer les infos suivantes:

CFLAGS="-march=nocona -O2 -pipe"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j3"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ "
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
cp -L /etc/resolv.conf /mnt/gentoo/etc/
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile
export PS1="(chroot) $PS1"
emerge --sync

Editez /etc/locale.gen

en_US ISO-8859-1
en_US.UTF-8 UTF-8
fr_FR ISO-8859-1
fr_FR@euro ISO-8859-15
fr_FR.UTF-8 UTF-8
locale-gen
cp /usr/share/zoneinfo/Europe/Paris /etc/localtime
emerge gentoo-sources
cd /usr/src/linux

Pour le kernel il vous faut le module r8169 pour la carte réseau, et choisir Core duo 2 cpu Family 6, voici un fichier de config pour le kernel-2.6.25-gentoo-r7 qui fonctionne.

Editez /etc/fstab

/etc/fstab
/dev/sda2               /               ext3            noatime         0 1
/dev/sda1               none            swap            sw              0 0

Attention chez moi la swap est en début de disque en général, vous avez un /boot et un / qui peuvent être ailleurs voir la doc d'install de gentoo.
Editez /etc/conf.d/hostname

Editez /etc/conf.d/net

dns_domain_lo="nobugware.com"
config_eth0=( "88.191.xx.xx netmask 255.255.255.0 brd 88.191.xx.255" )
routes_eth0=( "default via   88.191.xx.1" )

Editez /etc/hosts

emerge -uDv system
emerge reiserfsprogs mirrorselect metalog ...
rc-update add metalog default
emerge vixie-cron
rc-update add vixie-cron default
crontab /etc/crontab
Editez /boot/grub/grub.conf
default 0
timeout 30

title Gentoo Linux

root (hd0,1)
kernel /boot/bzImage root=/dev/sda2

Ici encore attention chez vous le root n'est peut être pas sda2 ni (hd0,1)

grub>  root (hd0,
 Possible partitions are:
   Partition num: 0,  Filesystem type unknown, partition type 0x83
   Partition num: 1,  Filesystem type is ext2fs, partition type 0x83

grub>  root (hd0,1)
 Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... failed (this is not fatal)
 Running "embed /boot/grub/e2fs_stage1_5 (hd0,1)"... failed (this is not fatal)
 Running "install /boot/grub/stage1 (hd0) /boot/grub/stage2 p /boot/grub/menu.lst "... succeeded
Done.
emerge openssh
rc-update add sshd default
rc-update add net.eth0 default

Configurer /etc/conf.d/clock
Ajouter un passwd root eventuelement
emerge sudo et le configurer

useradd -m -G users,wheel,audio -s /bin/bash john
passwd john
umount /mnt/gentoo/boot /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo
reboot

Vous avez une Gentoo 2008.0 64 bits sur votre dedibox XL.

Merci Juju pour les tests :)

Dec. 26, 2007

Restore only some files from a partimage backup

One month ago I've deleted some files in a terrible mistake :)

On my personal server (dedibox) I'm using partimage to backup the / only, it's a nice tool that provide a way to restore a bootable partition from a backup, very usefull for a remote administrated server.

But my need was only to restore some missed files (without restore all the /), at this time I don't think partimage is capable of that, one solution was to create a virtual partition and let partimage restore in it:

# first create a file large enough to contains all the files (and the filesystem metadata)
dd if=/dev/zero of=bigfile count=6144000 bs=1024
# load the kernel module
modprobe loop
# assign loop0 to your bigfile
losetup /dev/loop0 /opt/data/bigfile
# restore 
partimage restore /dev/loop0 /root/aton.sda2.partimg-20071020.gz.000 

# mount your virtual disk
mount /dev/loop0 /mnt

#copy your files
umount /mnt
losetup -d /dev/loop0

Thanks to SR for the idea

Dec. 22, 2007

Revue de presse du 24/12/07

Le numéro 100 de linux mag offre un CD contenant des articles des numéros 46 à 86 mais qui n'inclut aucun sommaire retrouvez les sur les numéros en questions: Numéro 46
Dans ce même numéro, un article sur twisted, Twisted Core Howto XMLRPC howto,XMLRPC with basic auth,JSONRPC twisted

Pencil un soft de dessin gratuit

Le mythe de pouvoir tout lire Trop de liens, trop de PDF à lire ?

Comparer le prix des bieres dans le monde

JRES 2007 video en ligne Présentation technique autour du net et des nouvelles technologies

Django Tunings Un très bon thread sur l optimisation Django face à une vrai prod, et Profiling django

Oct. 15, 2007

Dell Poweredge 1950/2950 RAC 5 with Ubuntu serial port

The Dells come with a Remote Access Controller, but with remote access Dell means only with windows ...

The remote video console only works with an ActiveX or with a special RPM client, so no mac and no Ubuntu, (Sun X4100 has a java remote video console that just work everywhere, think about it).

A good solution is to activate the serial port of the guest os then route it to the SSH access of the RAC card.

To do that, modify your grub config to make the grub menu appears on serial console:
Edit /boot/grub/menu.lst and add this after default 0

default         0

# show grub on serial console for dell 
serial --unit=1 --speed=57600
terminal --timeout=10 serial

Now you also need to make your linux kernel log everything on the serial port, to do that in the /boot/grub/menu.lst file again, add console=ttyS1,57600 right after all kernel entries like this:

title           Ubuntu, kernel 2.6.20-15-generic
root            (hd0,2)
kernel          /boot/vmlinuz-2.6.20-15-generic root=UUID=c13549c7-0ebc-4840-a01b-15e47a68f92a ro  console=ttyS1,57600
initrd          /boot/initrd.img-2.6.20-15-generic
quiet
savedefault

Great now you also need to give the console access to the linux for that, create a new file in /etc/event.d/ttyS1 and put this:

# ttyS1 - getty
#
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.

start on runlevel 2
start on runlevel 3
start on runlevel 4
start on runlevel 5

stop on runlevel 0
stop on runlevel 1
stop on runlevel 6

respawn
exec /sbin/getty -h  -L 57600 ttyS1 ansi

Add ttyS1 to the /etc/securetty file to have a root access, (which should not be usefull on Ubuntu).

Ssh your RAC ip (the one with the web interface), and enable console access for ssh (just one time):

racadm config -g cfgSerial -o cfgSerialSshEnable 1

You can now connect to the serial port everytime you want via the ssh access of the RAC, with the command connect com2, and login to your dead linux after you submit a wonderful new iptables rule ;).

Ps: ttyS1 is not a mistake, the rac serial port is com2.

Aug. 8, 2007

Revue de presse du 08/08/07

Django Syndication Framework

iCal et Django

Django RESTFUL

Les developpeurs de EVE online à propos de stackless python 2.5

Jython n'est pas mort 2.2rc3

Mysql 5 HA et DRDB

Redhat publie les docs du linux symposium 2007

Google architecture

La video du Mac Event du 7 aout

Le Acer N50 enfin sous linux ? video de boot