RikT
08-08-2012, 14:25
it would be nice if ovh could make it possible for us to do our own netinstalls in vkvm much easier for everyone then
#If your /dev/sda is not partitioned/broken, run cfdisk and create a bootable partition with at least 50 MB (or as large as your entire HDD) space to hold GRUB plus the netboot/mini.iso.
cfdisk
# Mount your bootable partition at /mnt
mount /dev/sda1 /mnt
# Install GRUB loader on your primary HDD
grub-install --boot-directory=/mnt/boot /dev/sda
wget -O /mnt/boot/mini.iso "http://mirror.ovh.net/ubuntu/dists/precise/main/installer-amd64/current/images/netboot/mini.iso" # Replace /mnt/boot/mini.iso with /boot/mini.iso if you have booted/rooted from your HDD.
menuentry "D-I Mini" {
insmod linux
insmod loopback
insmod iso9660
set iso=/boot/mini.iso
loopback loop (hd0,1)$iso
set root=(loop)
linux /linux iso-scan/filename=$iso noprompt noeject toram debian-installer/locale=en_US keyboard-configuration/layoutcode=us netcfg/disable_autoconfig=true netcfg/get_nameservers=8.8.8.8 netcfg/get_ipaddress=YOUR.OHV.HOST.IP netcfg/get_netmask=255.255.255.0 netcfg/get_gateway=YOUR.OHV.NET.254 netcfg/confirm_static=true netcfg/get_hostname=installer netcfg/get_domain=local anna/choose_modules=network-console network-console/password=r00tme network-console/password-again=r00tme preseed/early_command="anna-install network-console" mirror/country=manual mirror/http/hostname=mirror.ovh.net mirror/http/directory=/ubuntu mirror/http/proxy= DEBCONF_PRIORITY=critical
initrd /initrd.gz
}
grub-reboot --boot-directory=/mnt/boot X # Where X=# of your new menuentry, or
grub-reboot --boot-directory=/mnt/boot "D-I Mini" # By NAME
reboot
...disconnect...
ping YOUR.OHV.HOST.IP
...response...
ssh installer@YOUR.OHV.HOST.IP # Password: as set above (r00tme)
cp /proc/mounts /etc/mtab
Could not find device for /boot: Not found or not a block device.
cp -a /usr/lib/grub/x86_64-pc/* /boot/grub
grub-install /dev/sda
cp -R /usr /usr2
mkdir /usr2 && cp -R /usr/ /usr2 && rm /usr && mv /usr2/usr / && rmdir /usr2
root@rescue:/boot/grub# grub-install /dev/sda df: Warning: cannot read table of mounted file systems: No such file or directory df: Warning: cannot read table of mounted file systems: No such file or directory Could not find device for /boot: Not found or not a block device.
root@rescue:/boot/grub# cp /proc/mounts /etc/mtab root@rescue:/boot/grub# grub-install /dev/sda
cfdisk /dev/sda
mkswap /dev/sda1
mkfs.ext3 /dev/sda2
mkdir /ubuntu
mount /dev/sda2 /ubuntu
cp -R /usr /usr2
rm /usr; mv /usr2 /usr
mkdir workarea; cd workarea; wapath=$(pwd)
wget "http://archive.ubuntu.com/..../debootstrap_X.X.X_all.deb"
ar -x debootstrap_X.X.X_all.deb
cd /
zcat $wapath/data.tar.gz | tar xv
debootstrap --arch {ARCH} {DIST} /ubuntu http://mir1.ovh.net/ftp.ubuntu.com/ubuntu/
echo "127.0.0.1 localhost" > /ubuntu/etc/hosts
echo "{IP} {hostname}" >> /ubuntu/etc/hosts
echo "{hostname}" > /ubuntu/etc/hostname
auto lo iface lo inet loopback auto eth0 iface eth0 inet static address x.x.x.x netmask 255.255.255.0 network x.x.x.0 broadcast x.x.x.255 gateway x.x.x.254
/dev/sda2 / ext3 defaults 0 1
/dev/sda1 swap swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
mount --bind /dev /ubuntu/dev
mount --bind /proc /ubuntu/proc
chroot /ubuntu
apt-get update
apt-get install linux-image-server openssh-server grub
mkdir /boot/grub
grub-install /dev/sda
update-grub
passwd
exit
reboot