Welcome to the Linux Foundation Forum!

Install from hard drive partition

Has anyone perfected the art of universal install of distros from a hard drive partition?

I have tried the approach explained here, but not working for me. I have only tried this approach with absolute linux, but I get through the installation process, but after it says it is complete, it didn't actually install anything. Absolute Linux is Slackware based so wondering if that may be a problem.

I'm wondering if I need to know a more descriptive information about bzImage and initrd than what's shown in the how-to link above.

I am using GRUB2 as well and followed the manual for GRUB2 as that how-to doesn't actually explain the correct approach with GRUB2.

Here is what I imput:

menuentry 'Install Absolute Linux (/dev/sda3)' {
recordfail
insmod part_msdos
insmod vfat
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set 8420-4672
linux /bzImage root=UUID=8420-4672 rw quiet splash
initrd /initrd.img
}


The files were put into the root of a separate partition by themselves (/dev/sda3). 3 files, the iso image, bzImage and initrd.img. However, this approach is not working.

I haven't seen any other sites or explanations on this subject, but I am sure there is some kind of hack for this.

Comments

  • mfillpot
    mfillpot Posts: 2,177
    I have had no issues installing Slackware from hard disk via grub(legacy) using the files from the usbboot image, so the Slackware part of your message is incorrect.

    I am questioning where you state that it did not install the files, does that mean that you got through the installer, but upon reboot no files were written to disk? If that is the case are you sure that you chose to install the files on a newly formatted ext3, ext4 or reiserfs partition on the physical hard drive?
  • The installation was to a partition with ext3.

    Upon installation completion, I already knew it wasn't complete becuase it took less than a second. However, when I mounted the installed partition, the only thing that was put into the partition was the iso image and /var directory with more empty directories:
    [root@linwalker ~]# mount /dev/sda1 /mnt
    [root@linwalker ~]# cd /mnt
    [root@linwalker mnt]# ls -l
    total 24
    drwxr-xr-x. 2 root root 4096 Nov 24 06:02 iso
    drwx
    . 2 root root 16384 Nov 24 06:01 lost+found
    drwxr-xr-x. 3 root root 4096 Nov 24 06:01 var

    [root@linwalker mnt]# ls -l /mnt/var
    total 4
    drwxr-xr-x. 3 root root 4096 Nov 24 06:01 log

    [root@linwalker mnt]# ls -l /mnt/var/log
    total 4
    drwxr-xr-x. 3 root root 4096 Nov 24 06:01 setup

    [root@linwalker mnt]# ls -l /mnt/var/log/setup
    total 4
    drwx
    . 4 root root 4096 Nov 25 06:03 tmp

    [root@linwalker mnt]# ls -l /mnt/var/log/setup/tmp
    total 16
    -rw-r--r--. 1 root root 9 Nov 24 06:02 return
    drwxr-xr-x. 2 root root 4096 Nov 24 06:03 series
    drwxr-xr-x. 2 root root 4096 Nov 24 06:03 tagfiles
    -rw-r--r--. 1 root root 643 Nov 24 06:02 tempscript

    Since you use grub legacy successfully, I may just create a dedicated grub legacy partition and flag it for boot and grub mbr the boot for that partition when I do installs.

    I have had no issues installing Slackware from hard disk via grub(legacy) using the files from the usbboot image
    Is there a tutorial on how you install from hard disk with the help of usb boot image?
  • mfillpot
    mfillpot Posts: 2,177
    The steps I took to use legacy grab are pretty much the same, however it appears that I cannot find the tutorial anymore, I may have to write it up myself.

    By what I have seen of your configuration file and the outcome, it sounds like the package installation portion did not correctly find and read from the package list. Did you write the packages from the installation disk to the HDD or try to access them via a mounted loop to use the iso?
  • mfillpot
    mfillpot Posts: 2,177
    No guide was available for the grub(legacy) method so, here you are (for slackware).

    [ul][li]Download the usbboot image from ftp://slackware.osuosl.org/pub/slackware/slackware-13.1/usb-and-pxe-installers/usbboot.img.[/li]
    [li]mount it to /mnt/tmp with the command "mount -o loop usbboot.img /mnt/tmp/"[/li]
    [li]create a directory in your boot partition for the new files, I called it s-recover, "mkdir /boot/s-recover"[/li]
    [li]copy the files from the usbboot mounted directory into the new directory, "cp /mnt/tmp/* /boot/s-recover"
    The contents of the image are:
    -rwxr-xr-x 1 root root 653 2010-11-26 21:53 f2.txt*
    -rwxr-xr-x 1 root root 5689312 2010-11-26 21:53 huge.s*
    -rwxr-xr-x 1 root root 14060973 2010-11-26 21:53 initrd.img*
    -r-xr-xr-x 1 root root 14998 2010-11-26 21:53 ldlinux.sys*
    -rwxr-xr-x 1 root root 569 2010-11-26 21:53 message.txt*
    -rwxr-xr-x 1 root root 2823 2010-11-26 21:53 setpkg*
    -rwxr-xr-x 1 root root 5720656 2010-11-26 21:53 speakup.s*
    -rwxr-xr-x 1 root root 313 2010-11-26 21:53 syslinux.cfg*
    [/li]
    [li]Make an entry into menu.lst for the new boot option, using the kernel and initrd image from the usbboot image:
    title Slack-recover
      root (hd0,1)
      kernel /boot/s-recover/huge.s ro
      initrd /boot/s-recover/initrd.img
    
    [/li][/ul]

    Slackware allows installation from network, so I just use the network install option and point to my local mirror for the sources, but you can choose to extract the files from the installation disk into a directory, or use a mount by loopback to read the iso image and install completely from disk.
  • Success!

    After your comment I went back to look at my approach.

    I then added the mount loop. I used -o loop to mount my iso file on /mnt/isotemp, then copied the directories containing bzImage, initrd, and the package directory, (absolute) to my mounted installation source partition.

    Then at the installation process, it dawned on my that I had been pointing the installer to my iso file instead of the distro package directory (absolute). So I pointed the installer to my package directory and the installation succeeded.

    It turns out that Slackware based distros as Absolute Linux is, are the easiest to install with this method.

    When I "ls -l" the directory after "mount -o loop /data/OS/absolute-13.6.1.iso /mnt/isotemp/" I find that the files are all read&write which allows me a simple install. However when mounting non-Slackware based distros, the files are all read-only, and the package that I must point the installer to are images instead of files.

    I mounted Zenwalk, another Slackware distro, and it is read-write as well and should have no problems installing with this method.

    I am working with non-Slackware distros to see if this will work universally as Slackware has already proven to be successful with this method. For the read-only distros I can copy over the files from the mounted directory with "cp -r <source files> /<target directory>", however, I still have the problem of dealing with images instead of files.

    As an update, my current non-Slackware distro boots to it's screen but after a couple seconds fails to this message:

    According to /mtab, /dev/sda7 is already mounted on /sysroot. Already mounted or /sysroot is busy. Then follows with "Unable to mount root files system".

    However, my image and initrd is pointed to the correct files:
    menuentry 'Install Fuduntu (/dev/sda7)' {
    	recordfail
    	insmod part_msdos
    	insmod ext2
    	set root='(hd0,msdos7)'
    	search --no-floppy --fs-uuid --set 8420-4672
    	linux	/EFI/boot/vmlinuz0 root=/dev/sda7 rw quiet splash
    	initrd /EFI/boot/initrd0.img
    }
    


    Also /dev/sda7 doesn't have an /mtab as it is only holds my isos, so I checked my distro holding grub, and /mtab doesn't show /dev/sda7, nor does /fstab.

    I will continue to rummage around until I figure something out.
  • mfillpot
    mfillpot Posts: 2,177
    I am glad to see that my instructions helped, I am a loyal slackware user because of the simplicity provided by a lack of automated function and assumed actions.

    Try changing the bootloader lines to remove the partition reference so that the image is loaded into RAM and /dev/sda7 is unused and waiting to be manually mounted for use.
  • mfillpot
    mfillpot Posts: 2,177
    As a note I have been able to get slackware and ubuntu (alternate installer) to boot and run perfectly in lilo and the grub options may not differ much. I will be writing some blog based tutorials for partition based installations later to cover what I found.

    for what you are trying to accomplish look into the loopback option in grub2 which ideally should allow you to just mount an iso from the bootloader, I will try it myself and cover it in my tutorials.

Categories

Upcoming Training