su gparted /dev/sda fdisk /dev/sda Disk /dev/sda: 40 GiB, 42949672960 bytes, 83886080 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x17f5438f Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 83886079 83884032 40G 83 Linux mkfs.ext4 /dev/sda1 mkdir /mnt/tmp mkdir /mnt/cdrom mount /dev/sda1 /mnt/tmp mount /dev/sr0 /mnt/tmp cd / cp -r --preserve=all {bin,home,lib64,srv,var,etc,lib,opt,root,sbin,usr} /mnt/tmp cd /mnt/tmp mkdir {dev,mnt,proc,run,tmp,boot,boot/grub,media,sys} cp /mnt/cdrom/linux/boot/vmlinuz /mnt/tmp/boot cat > /mnt/tmp/boot/grub/grub.cfg << "EOF" # Begin /boot/grub/grub.cfg set default=0 set timeout=5 insmod ext2 set root=(hd0,1) menuentry "Umvirt Linux From Scratch 0.1" { insmod gzio insmod part_msdos linux /boot/vmlinuz root=/dev/sda1 rootfstype=ext4 ro } EOF cat > /mnt/tmp/etc/fstab << "EOF" # Begin /etc/fstab # file system mount-point type options dump fsck # order /dev/sda1 / ext4 defaults 1 1 #/dev/sda2 swap swap pri=1 0 0 # End /etc/fstab EOF grub-install --boot-directory=/mnt/tmp/boot /dev/sda echo "ulfs-desktop" > /mnt/tmp/etc/hostname umount /dev/sda qemu-img -hda /dev/sda -m 512