Find the answer to your Linux question:
Results 1 to 8 of 8
Hi, I have a Linux installation that's installed on a SATA drive that works sort of like a boot disk, in that it boots up a customized Linux kernel on ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Apr 2008
    Posts
    127

    Migrating a Linux installation from SATA drive to CD-ROM


    Hi,

    I have a Linux installation that's installed on a SATA drive that works sort of like a boot disk, in that it boots up a customized Linux kernel on a large variety of x86 PCs and runs a specific program once booted up. The Linux installation is text based and the file system is ext2.

    Currently I'm using LILO boot loader as its simple and serves its purpose.

    However, I need to port this boot disk over to a CD-ROM. I'm not sure what I need to do for this migration to work, but I suppose I would at least need to migrate from LILO to something like ISOLINUX?

    How would I go about such a migration? Would it actually be easier to create a generic Live-CD and add in my boot up program and associated drivers required that are required? If so, how?

    Thanks.
    Last edited by galapogos; 10-19-2011 at 09:37 AM.

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    You should be able to create a bootable CD with either Grub or Isolinux.
    Which Linux distribution do you have on your main (non-SATA) drive?
    Do you have a Linux CD with the isolinux folder?
    Do you have a system with Grub? Grub Legacy or Grub2?

  3. #3
    Linux Newbie
    Join Date
    Apr 2008
    Posts
    127
    It's a custom Linux installation, not any specific distribution.

    Not sure what you mean by having a Linux CD with an ISOLINUX folder. I do have several Linux Live/recovery CDs from various distros.

    I have systems with LILO, but it's trivial to install another Linux distro and use Grub instead.

    My intention is to have a very simple, small Live CD that doesn't even have initrd nor boot into a GUI. Everything that I need will be built into the kernel, and I only need a small subset of all the device support so the kernel will be relatively small.

  4. #4
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    It's a custom Linux installation, not any specific distribution.
    I take that to mean that your custom Linux installation is the only operating system and that the SATA is the only drive on your computer, is that correct? If not, some details would be helpful.

    Not sure what you mean by having a Linux CD with an ISOLINUX folder
    If you are planning to use isolinux to boot the CD, you will need the isolinux boot files so that's one step.

    Is your custom installation on a single partition on the SATA drive? Were you planning to do this using a Linux Live CD or do you have any Linux installed to a hard drive other than your custom install?

  5. #5
    Linux Newbie
    Join Date
    Apr 2008
    Posts
    127
    Quote Originally Posted by yancek View Post
    I take that to mean that your custom Linux installation is the only operating system and that the SATA is the only drive on your computer, is that correct? If not, some details would be helpful.
    Yes, it's the only OS on the SATA drive, which may not be the only drive, but is always configured as the 1st drive, hence is always /dev/sda. The OS resides in the 1st partition of that drive, or /dev/sda1.

    Quote Originally Posted by yancek View Post
    If you are planning to use isolinux to boot the CD, you will need the isolinux boot files so that's one step.
    I'm entirely unfamiliar with isolinux or other boot loaders that support ISO9660. I'm not sure what the isolinux boot files are. Could you explain that to me or point me to a resource for more information? Thanks.

    Quote Originally Posted by yancek View Post
    Is your custom installation on a single partition on the SATA drive? Were you planning to do this using a Linux Live CD or do you have any Linux installed to a hard drive other than your custom install?
    Yes it's on a single partition /dev/sda1. There's no other partition in the SATA drive. The SATA drive only has my custom Linux OS installed, which includes an ext2 root file system, a custom configured kernel downloaded from kernel.org with all unused kernel options disabled, and all needed device drivers/file system statically built into the kernel so as to avoid using initrd. I've also installed the necessary libraries required by my program.

    So currently, the SATA drive boots up and immediately runs the program.

    I would like to have a CD that does exactly that - boot up and immediately run the program.

  6. #6
    Linux Newbie
    Join Date
    Apr 2008
    Posts
    127
    anyone? would appreciate any help.

  7. #7
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    I think you could probably use the knoppix method listed here to get you started. It's the middle link. And yes, you need isolinux - it is not too scary. Really, you just need isolinux.bin and a properly configured isolinux.cfg in an /isolinux directory in your ISO image. Then when you call your command to create the ISO, do something like:

    Code:
    mkisofs -v -l -U -J -R -T -V "myVolName" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o /tmp/myisofile.iso /tmp/myDistroBase/

  8. #8
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    What I would do is create another partition on the SATA. Copy all the files from your custom partition and then go through the steps below. If it works and you get a working CD, just delete the second partition. Much less risk and you won't be changing your working partition.

    Boot the Linux Custom installation. Put a Linux Live CD in the drive. If it auto-mounts, copy the isolinux folder to your SATA drive partition (on the CD I used it is 13MB). If it doesn't auto-mount loop mount it in the terminal. First create a mount point

    mkdir /mnt/test
    For simplicity sake assume the CD is called linux.iso:

    mount -o loop linux.iso /mnt/test
    You will need the isolinux.cfg, isolinux.bin and boot.cat files. Either copy the isolinux folder and all of its contents or create an isolinux folder and copy the necessary files. Most of the others are optional, especially those with a .hlp extension so if you don't want to copy all at least copy those into the isolinux folder. You will have to modify the isolinux.cfg file to boot your custom install by changing the entry.

    Re-boot with the Linux Live CD in the drive.
    Create a mount point for you custom installation. I don't know if it will be sda1 so...?:

    mkdir /mnt/sda1
    Mount it:
    mount -t ext4 /dev/sda1 /mnt/sda1
    If the filesystem type is not ext4 change it.

    Change to the /mnt directory and run the command posted by atreyu or the one below

    mkisofs -o custom.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table sda1

    Should work and create an iso file named custom.iso. It would be much simpler if you had an actual Linux installation you could use to work on your custom install. Booting a full Linux install with your SATA drive attached you could create a separate directory in which to test all this without affecting the system on your SATA.

    Not having any information on what you have in your custom installation, it's difficult to say how this will work. I've used it a number of times to create bootable CDs from a normal Linux installation.
    Last edited by yancek; 10-21-2011 at 04:02 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •