ubuntu下grub启动硬盘iso安装ubuntu

1)将ISO文件放在干净的分区中

     mount ubuntu-12.04-desktop-i386.iso /tmp/iso

     mount /dev/sda5 /tmp/install

cd /tmp/iso
    cp -pr ./* /tmp/install
    cp -pr ./.disk /tmp/install

2) 查看硬盘UUID

ls /dev/disk/by-uuid -l

3) 编辑ubuntu grub

vim /boot/grub/grub.cfg

添加如下menu:

menuentry "ubuntu 12.04 install" {
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set=root f4fbcdf1-0fc8-4dc4-8e9f-3dfad68d38a3
        loopback loop /ubuntu-12.04-desktop-i386.iso
        linux (loop)/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash locale=zh_CN.UTF-8 rtc_cmo
s=localtime iso-scan/filename=/ubuntu-12.04-desktop-i386.iso
        initrd (loop)/casper/initrd.lz
}

4)重启安装


你可能感兴趣的:(server)