How to change host name?


Forum: HD Install
Topic: How to change host name?
started by: ggiles

Posted by ggiles on Aug. 13 2006,21:54
Hi,
I have a frugal laptop install, and can't figure out how to change the hostname. Tried searching the wiki and forum, found two approaches neither of them work, looking for help and ideas.

1. Added host 'cheat code' to lilo (/cdrom/boot/lilo.conf), tried various options / combos (including putting 'dsl' in front of 'host'), however entering 'hostname' from a shell still reports 'box'.

Quote
lba32          #enable large disk support
timeout=30     #wait 3 seconds before auto-booting
vga=791
boot=/dev/hda   #put boot loader in MBR of target disk
root=/dev/hda1 #set root to be partition of target disk
image=/boot/linux24
label=DSL
initrd=/boot/minirt24.gz
read-only
APPEND="ramdisk_size=100000 init=/etc/init lang=us apm=power-off hda=scsi hdb=scsi hdc=scsi hdd=scsi hde=scsi hdf=scsi hdg=scsi hdh=scsi nomce nodma quiet host=LinuxLaptop frugal BOOT_IMAGE=/KNOPPIX/KNOPPIX     "


2. Tried changing /etc/hostname, /etc/hosts and /etc/init.d/knoppix-autoconfig. None of these survive a reboot, as these files are copied from the ISO image at bootup.

Any ideas or suggestions most welcome

Thanks
Greg

Posted by Del on Aug. 13 2006,22:13
When you modify lilo.conf you have to rerun lilo to make it take hold. To make this happen in a frugal install try this;
mount /mnt/hdaX (where X is the partition containing /boot)
edit /mnt/hdaX/boot/lilo.conf and add the host=blarg boot option
ln -sf /mnt/hdaX/boot / (symlink /mnt/hdaX/boot to /boot )
lilo -C /mnt/hdaX/boot/lilo.conf (run lilo with desired config file)
reboot

--edited for correct lilo args--

Posted by ^thehatsrule^ on Aug. 13 2006,22:53
you could also just commit it to the mbr using lilo -C /path/to/lilo.conf
Posted by Del on Aug. 14 2006,00:51
If I don't "ln -sf /mnt/hdaX/boot /" before running "lilo -C /mnt/hdaX/boot/lilo.conf" I get an error "Fatal: Trying to map files from unnamed device 0x0007 (NFS ?)". After doing the symlinking lilo acts as expected.

My mistake though in my previous post, you do indeed still have to use "lilo -C /mnt/hdaX/boot/lilo.conf", otherwise lilo tries to use /etc/lilo.conf.

Posted by ggiles on Aug. 14 2006,02:54
Thanks guys, it worked perfectly. I wish the wiki was open for editing, it's been hard to find this info anywhere else.

Thanks
Greg

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.