Booting antiX Frugal-only From HDD Without Any Full-Installed OS – with Extlinux

Forum Forums General Tips and Tricks Booting antiX Frugal-only From HDD Without Any Full-Installed OS – with Extlinux

  • This topic has 51 replies, 8 voices, and was last updated Aug 20-6:40 am by anilkagi.
Viewing 15 posts - 1 through 15 (of 51 total)
  • Author
    Posts
  • #24822
    Member
    christophechristophe

    Booting antiX Frugal-only From HDD Without Any Full-Installed OS – with Extlinux

    I’ve got a couple old computers on which I wanted to run antiX frugal (frugally? frugal-style?), but I ran into a problem: How do I boot without already having a linux distribution “fully-installed” to use the bootloader?

    I could always use the antiX Live USB to boot frugal, but I wanted to avoid that if at all possible. I wanted the possibility to have several separate instances of frugal antiX on the hdd to choose from (without carrying several Live USBs around). Other exotic solutions involved convoluted twists and turns that were difficult for me to understand and use and/or to explain the steps to others.

    Then I thought, “Since antiX Live USBs all boot from syslinux/isolinux/extlinux (without an “installed” OS — by its USB/ISO nature), then would this work from the hard drive of my computers?” I figured it SHOULD work… somehow.

    My project was to boot antiX 17 & antix 19, as well as any future frugal projects that I may want to add.
    I like running frugal installs, because: it seems to run just as fast as a full install on these 32-bit machines I have; I can place many frugals on one hdd and share the same Live-usb-storage directory without any additional setup. Also because it’s just plain fun to tinker. (I have made a games-only personal remix, and a kodi movies-only frugal remix for my grandchildren — mainly silly perhaps, but legitimate uses of old hardware, I think.) But I didn’t want to have to make a full install of anything just to get the bootloader. And extlinux looked promising.

    Searching the internet was tedious in the extreme, with many gaps in instructions for what I intended to do — nothing was really tailored for my project. After some false starts, including two situations rendering my test computers unbootable from the hard drive (because of my own error), I figured out how to do it. And it’s very easy, actually. And SIMPLE. All the software is already installed on antiX (as of 19.b2, anyway).

    An important note before I outline the steps:

    IT IS IMPORTANT TO FOLLOW THESE STEPS IN ORDER.

    On my second computer (after a successfully-installed first computer), I missed a step, went back to complete it, then repeated the previous step and finished all the other steps… only to find the bootloader didn’t work. (“Drat you Linux! Foiled again!!) I had to backup my hdd data via a live usb, reformat the drive, and start again. The second try worked exactly as expected, though, so I know these instructions are solid.

    These instructions are for a bios-based computer, because I don’t have any UEFI computers.

    This is my starting point: bios computer; booting from antiX 19.b2 Live USB (although I suspect 17-series would work also); 60 GB hdd, which has all needed data backed up (because we’ll format it).

    1. Boot the live antiX USB. Don’t use persistence or toram option.

    2. Go to your root (or “start”) menu: start Applications -> System -> Gparted. Once it opens, make sure you’re operating on SDA.
    a. At the top menu, select Device -> Create partition table. Make sure “msdos” is selected (it’s the default on my systems) & click OK.
    b. Create your partitions: I chose 55000 MB as sda1; the rest created as linux-swap.
    c. Go ahead and make gparted perform the operations.
    d. Once it has completed, right-click on sda1, select Manage flags. Select the “boot” flag, and then close the dialog box. And close gparted.

    3. Go to your root (or “start”) menu again; click “Run.” This opens the gexec program. Tick the boxes for “Keep Open this dialog after launch” and “Run as root,” because we’ll use it to launch three things:
    a. first time, type “geany” (without quotes) in the “Run Command” text box. Leave this for now; minimize it if you want.
    b. second time, type “rox” as the command. Be sure to re-check “run as root.”
    c. third time, repeat “rox” as root again (we need two ROX filer windows open). Afterward, close the Run dialog box.

    4. Go to your root (or “start”) menu yet again; start Applications -> System -> Root Terminal. This is to avoid having to type “sudo” before each command we enter into the terminal.

    5. In the Root Terminal, run the following commands, one at a time:
    # mkdir /media/sda1
    # mount /dev/sda1 /media/sda1
    # mkdir /media/sda1/boot
    # mkdir /media/sda1/boot/extlinux

    5. Copying your frugal files to the hdd:
    a. In one of the open “run as root” ROX Filer windows, navigate to /live/boot-dev. Here you should see the “antiX” directory. This is where the antiX OS is stored on the Live USB. Open the other open root ROX window to /media/sda1. Simply drag the “antiX” folder from /live/boot-dev to the other window opened to /media/sda1. Choose “copy” when you release your dragging action. This copies it, including any persistence files you may have created prevously on your Live-USB.

    6. Installing the Extlinux bootloader:
    a. We need the following packages, WHICH ARE ALREADY INSTALLED IN ANTIX BY DEFAULT: extlinux, syslinux, syslinux-common. I list these to be complete, in case the installed applications ever change in future antiX releases.
    b. Install the extlinux bootloader:
    # extlinux –install /media/sda1/boot/extlinux
    c. And copy the bootloader to the MBR, using the “dd” command:
    # dd if=/usr/lib/EXTLINUX/mbr.bin of=/dev/sd1 bs=440 count=1

    7. Copy the following files from /usr/lib/syslinux/modules/bios to /media/sda1/boot/extlinux :
    cmenu.c32, libcom32.c32, libmenu.c32, libutil.c32, menu.c32, vesmenu.c32.
    (ldlinux.sys & ldlinux.c32 are already there from the installation step.)
    To do this, open you ROX filer windows to the two directories, and drag them over, like before.
    (Hint: If you’re not used to ROX Filer, you hold down the Ctrl key before you click a file, to select it. This way you can select all 6 files to drag.)

    8. In your Root Terminal, run # touch /media/sda1/boot/extlinux/extlinux.conf (You’ll edit it soon; it’s the boot menu.)

    9. Add “splash.png” (any 640×480 png image) as background. (I say “any” because that’s my understanding. I’ve attached one or two that I found, which I know from experience work.) Drag this image over in your root ROX windows, like you did previously.

    10. Using your “geany” window that you opened waaay back in step 3, edit your /media/sda1/boot/extlinux/extlinux.conf file. The following is an example, which I found online and heavily edited for my uses.
    a. Note that under the LABEL heading, there are only 4 lines, titled: MENU LABEL, LINUX, APPEND, & INITRD. My “LINUX” line is long & many times a text editor breaks this line into two. Make sure you make these as only 4 lines.
    b. More notes:
    (1.) UI vesamenu.c32 needs to be at the top
    (2.) TIMEOUT is in tenths of seconds, so my computer is set to boot in 20 seconds if nothing is selected prior to that.
    (3.) LINUX heading shows the UUID of the boot hdd (sda1). In the Terminal, run “blkid” (no quotes) to get your UUID for sda1. Copy & paste your correct UUID into both places on each frugal install you are setting up. (One is after “root=UUID=” and the other is after “buuid=”).
    (4.) I don’t pretend to know if some of this can be streamlined/simplified, but I do know this has worked for me twice as of this writing.
    (5.) The APPEND line holds any additional antiX boot codes you use (see the antiX FAQs, if needed).
    (6.) The cool thing about antiX (one of many, that is), is that frugal antiX updates the kernel from the OS via Live USB Kernel Updater, so nothing is needed to do here in the bootloader in order to update the kernel.
    (7.) All you have to do to add another frugal install (for example, MX), is to place another entry in this file!

    #this is an example /boot/extlinux/extlinux.conf file
    # In the “MENU COLOR border” line the table is white. If it does not fit with the theme, comment on it and it will return to Default.

    UI vesamenu.c32
    TIMEOUT 200
    MENU TITLE antiX Linux frugal installs
    MENU BACKGROUND splash.png
    MENU COLOR border 30;44 #40ffffff #a0000000 std

    LABEL l0
    MENU LABEL antiX 19.b2, static persistence, zram enabled
    LINUX /antiX/vmlinuz root=UUID=1071a266-a5ce-4cfd-b0b5-2765e54e5f02 bdir=antix-19 buuid=1071a266-a5ce-4cfd-b0b5-2765e54e5f02
    APPEND persist_static vga=default quiet splasht=va
    INITRD /antiX/initrd.gz

    #LABEL l1
    # MENU LABEL MX Linux 18, static persistence, zram enabled
    # LINUX /MX/vmlinuz root=UUID=1071a266-a5ce-4cfd-b0b5-2765e54e5f02 bdir=MX buuid=1071a266-a5ce-4cfd-b0b5-2765e54e5f02
    # APPEND persist_static vga=default quiet splasht=va
    # INITRD /MX/initrd.gz

    Once you have your menu finished, the setup is complete! Simply close your open program windows & reboot. This is a nicely self-contained bootloader, independent of any installed OS.

    Next things to do (perhaps):
    Add chain.c32 to chainload boot a full-installed linux on another partition (or Windows).
    Add memdisk to boot ISO images, floppy images, or hard disk images.

    #24832
    Moderator
    fatmacfatmac

    Nice – I’ll make it a ‘sticky’ – thanks.

    Linux (& BSD) since 1999

    #24833
    Forum Admin
    anticapitalistaanticapitalista

    Many thanks for this, christophe

    Philosophers have interpreted the world in many ways; the point is to change it.

    antiX with runit - leaner and meaner.

    #25180
    Member
    christophechristophe

    I found a typo:

    c. And copy the bootloader to the MBR, using the “dd” command:
    # dd if=/usr/lib/EXTLINUX/mbr.bin of=/dev/sd1 bs=440 count=1

    This should be:

    # dd if=/usr/lib/EXTLINUX/mbr.bin of=/dev/sda bs=440 count=1

    #25948
    Member
    Avatarsjs

    Hello Christophe

    Interesting approach – I tried it, and it works fine on 17.

    My hope was that I could use it to accomplish my goal:
    I need to boot from hd and copy system entirely to ram, and run from there.
    I tried to do this from live USB/toram, and it works just fine, but I can’t figure out how to make it work booting from a harddrive.
    Wonder if you or anyone reading this could come up with a way to do just this.

    PS: No big deal, but your pix are not 640×480, hi.

    Best regards Soeren

    #25970
    Member
    christophechristophe

    sjs- Regarding the slash images, if you click on the picture before downloading, (making it full screen) then right-clicking to save-as, then it will download at the correct resolution. (I just verified, to make sure). Regarding the toram parameter, I’ll play around with it when I get some time …

    • This reply was modified 1 year, 1 month ago by christophe.
    #25976
    Member
    Avatarsjs

    Hello again

    Your system actually works for me with the toram option added (I just need to spell it correctly, hi).

    Thanks a lot for paving the road, it has been very helpful.

    Rgds Soeren

    #27643
    Member
    christophechristophe

    IF you also want to boot a regular “installed” OS on another partition,

    1. as root, copy /usr/lib/syslinux/mbr/modules/chain.c32 to (the boot device’s) /boot/extlinux

    2. edit extlinux.conf with:
    LABEL l4
    MENU LABEL antiX19.b3 full install
    COM32 chain.c32
    APPEND hd0 2

    The last line of “APPEND hd0 2” refers to the bootloader (installed to the PBR) of the first hard disk and the second partition (hard disk counting starts with 0 (zero), and the partition counting starts with 1 (one) — I know, crazy, right?)

    #40158
    Member
    Avataranilkagi

    Hello there,

    I wanted to;

    Boot antiX Frugal-only From HDD Without Any Full-Installed OS – with Extlinux

    as suggested in this thread because I was attracted in this prospect of “booting without already having a linux distribution fully-installed to use the bootloader”.

    I carried out all the steps described here meticulously.

    First I tried in VBox and then on a HD partition. However I was not successful in booting into the frugal-only-install in both.

    I did the following;

    1] Boot into USB live antix-19.2.1-x64-Base > F5 > Frugal_only > Enter to boot.

    2] Menu > Applications -> System -> Gparted > Device -> Create partition table > Select “msdos” > Create new partitions for System and Swap > Right click on System partition > Manage flags > boot > Close Gparted.

    3] In the Root Terminal run the following commands:

    `mkdir /media/sda1
    mount /dev/sda1 /media/sda1
    mkdir /media/sda1/boot
    mkdir /media/sda1/boot/extlinux`

    4] Drag-and-drop-copy in ROXfiler-as-root > “antiX” directory from /live/boot-dev to /media/sda1

    5] In root terminal run the following commands:

    `extlinux –install /media/sda1/boot/extlinux
    dd if=/usr/lib/EXTLINUX/mbr.bin of=/dev/sda bs=440 count=1`

    6] Drag-and-drop-copy in ROXfiler-as-root > cmenu.c32, libcom32.c32, libmenu.c32, libutil.c32, menu.c32, vesamenu.c32. (ldlinux.sys & ldlinux.c32 are already there) from /usr/lib/syslinux/modules/bios to /media/sda1/boot/extlinux

    7] In the Root Terminal run the following command:

    touch /media/sda1/boot/extlinux/extlinux.conf

    8] Drag-and-drop-copy in ROXfiler-as-root > “splash.png” from /usr/share/wallpaper to /media/sda1/boot/extlinux
    (Downloaded it from this page, as I liked it.)

    9] In the Root Terminal run the following command:

    sudo blkid

    Add the UUID from the above returns into extlinux.conf.

    10] Rox-filer > /media/sda1/boot/extlinux/extlinux.conf > Right click > Edit as root > as below;

    UI vesamenu.c32
    TIMEOUT 200
    MENU TITLE antiX Linux frugal installs
    MENU BACKGROUND splash.png
    MENU COLOR border 30;44 #40ffffff #a0000000 std

    LABEL l0
    MENU LABEL antiX 19.2.1 Base, frugal only, zram enabled
    LINUX /antiX/vmlinuz root=UUID=1071a266-a5ce-4cfd-b0b5-2765e54e5f02 bdir=antix-19 buuid=1071a266-a5ce-4cfd-b0b5-2765e54e5f02
    APPEND frugal_only vga=default quiet splasht=va
    INITRD /antiX/initrd.gz

    #LABEL l1
    # MENU LABEL MX Linux 18, static persistence, zram enabled
    # LINUX /MX/vmlinuz root=UUID=1071a266-a5ce-4cfd-b0b5-2765e54e5f02 bdir=MX buuid=1071a266-a5ce-4cfd-b0b5-2765e54e5f02
    # APPEND persist_static vga=default quiet splasht=va
    # INITRD /MX/initrd.gz

    11] Shutdown
    12] Remove USB live
    13] Reboot

    Then I get this error.

    fatal error: device found but could not find antix-19/linuxfs file on device

    I got the errors as shown in the attached images below;

    I repeated this process several times but with no success.

    My guess is the issue may be in performing the step ‘6a’;

    6. Installing the Extlinux bootloader:
    a. We need the following packages, WHICH ARE ALREADY INSTALLED IN ANTIX BY 
    DEFAULT: extlinux, syslinux, syslinux-common. I list these to be complete, 
    in case the installed applications ever change in future antiX releases.

    However, I get the boot-menu and I see “Syslinux” displayed on the screen before that.

    I don’t know what am I doing wrong. Please throw some light on this.

    Thank you & Regards.

    • This reply was modified 1 month, 2 weeks ago by anilkagi.
    #40166
    Member
    Avatarolsztyn

    root=UUID=1071a266-a5ce-4cfd-b0b5-2765e54e5f02 bdir=MX buuid=1071a266-a5ce-4cfd-b0b5-2765e54e5f02

    It looks like you might have copied UUID values from Christophe’s hard drive. This will not work. You need to use UUID values specific for your own drive/partition for the boot to see your installs and boot them.

    • This reply was modified 1 month, 2 weeks ago by olsztyn.
    #40168
    Member
    XecureXecure

    1] Boot into USB live antix-19.2.1-x64-Base > F5 > Frugal_only > Enter to boot.

    What happened after hitting Enter? Did you follow the steps to install/setup frugal? If so, where did you install it? Can you boot to it from live USB?
    In whatever partition you installed it, there is a now a folder named something similar to antiX-Frugal-4.9.212-antix.1-amd64-smp. Your frugal install is there.
    Access that folder and you can find a file named grub.entry that contains all the relevant frugal information for booting that you need for step 10.

    I recommend you watch dolphin_oracle videos on frugal (this one is quite good) to understand a bit about frugal install. You can skip the part about adding it to grub, as you are using extlinux, but you can still learn a bit.

    #40176
    Member
    christophechristophe

    Hello anikagi,

    Since you are using the instructions on this post, you don’t need to boot the live usb into frugal mode. Just regular live boot works.

    But according to these instructions, olstyn is right – just copy & paste your blkid over the example in the post, in your extlinux.conf file.

    Also,change your extlinux.conf file to reference the “antiX” folder, not “antix-19”. (Or rename the “antiX” folder to “antix-19” – and be aware of capitalisation.)

    I think that will get it to work.

    #40184
    Member
    Avataranilkagi

    Thank you Olsztyn, for coming.

    No, I actually added the returns of the command “blkid”. I copied the UUID of the sda1 from there. Here I have just copied the step of Christophe, to demonstrate what I did. In the previous step I issued “blkid” command in the terminal and got the UUID from there.

    #40185
    Member
    Avataranilkagi

    Thanks Xecure for coming,

    What happened after hitting Enter? Did you follow the steps to install/setup frugal? If so, where did you install it? Can you boot to it from live USB?

    After hitting enter, it brought up choices to install frugal on sda1 or to continue to boot. I terminated frugal install and continued to boot. And then followed the steps of Christophe as given in this thread. I drag-drop-copied the “antix” directory from /live/boot-dev to /media/sda1.

    Yes, I could boot from the USB. When it failed to boot from the HD, I mounted the USB live again on both VM & HD and tried to verify if I had done anything wrong. While it again asked to do frugal install but I chose normal boot. I could boot without problems into the Live USB.

    In whatever partition you installed it, there is a now a folder named something similar to antiX-Frugal-4.9.212-antix.1-amd64-smp. Your frugal install is there.

    Yes, I tried this a few times. I did the frugal install and found the antiX-Frugal-4.9.212-antix.1-amd64-smp and then repeated the rest of the steps from this thread, that did not help. I even changed the name from “antiX-Frugal-4.9.212-antix.1-amd64-smp” to “antix” and then again to “antix-19” and tried but that didn’t succeed.

    Access that folder and you can find a file named grub.entry that contains all the relevant frugal information for booting that you need for step 10.

    Thanks for this tip, this would be helpful. However, I think I did that correctly. I have given above in my post what the edited file looked like, except that I haven’t shown the correct UUID here. While editing the file I added the UUID I got from issuing the command “blkid”.

    I recommend you watch dolphin_oracle videos on frugal (this one is quite good) to understand a bit about frugal install. You can skip the part about adding it to grub, as you are using extlinux, but you can still learn a bit.

    Yes, I have watched it. I have actually downloaded with the help of “youtube-dl”. I have watched it several times, it is really informative. That is where I came to know how to skip the frugal install and choose normal boot.

    #40186
    Member
    Avataranilkagi

    Thanks Christophe for coming.

    Since you are using the instructions on this post, you don’t need to boot the live usb into frugal mode.

    Ah! I always suspected this could be where I was doing wrong.

    I have been choosing to boot the live usb into frugal only mode, but does this really matter? I mean, when I making changes to /dev/sda1 and don’t need any changes on the live usb, does it really matter, whether I choose frugal only mode or any other mode? I am just curious.

    Just regular live boot works.

    By regular boot, does it mean leaving the F4 & F5 options untouched like below?

    F4 Options: none
    F5 Persist: off

    If this affects the installation, then I am doing this wrong. I have been changing the F5 as below;

    F5 persist: frugal_only.

    Does this affect the installation?

    Also,change your extlinux.conf file to reference the “antiX” folder, not “antix-19”. (Or rename the “antiX” folder to “antix-19” – and be aware of capitalisation.)

    Yes, I did that a few times but that didn’t help. However before doing that I had kept it as “antix” without capitalising, but that had not worked either. I shall keep this in mind next time when I do it.

Viewing 15 posts - 1 through 15 (of 51 total)
  • You must be logged in to reply to this topic.