SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm running into this error when trying to build a usb bootable disk for 14.1. I did not have any problems when I did this for current. Here is the code:
Code:
--- Available free space on the the USB drive is 3907100 KB
--- Required free space for installer: 37040 KB
--- Copying boot files to the USB drive...
--- Extracting Slackware initrd.img...
--- Modifying installer files...
--- Gzipping the initrd image again:
--- Copying Slackware package tree to the USB drive...
--- Cleaning up the staging area...
--- Making the USB drive '/dev/sdb' bootable...
*** /usr/local/sbin/usbimg2disk.sh FAILED at line 483 ***
--- Cleaning up the staging area...
umount2: No such file or directory
umount: /mnt/img.e7hs8B: not found
Judging by the line number of that error you are using the usbimg2disk.sh script from my web site and not the somewhat shorter version contained in Slackware's usb_and_pxe_installer directory.
The error occurs on the line which calls the "makebootable" function, which uses sfdisk to set the first partition bootable. Perhaps your computer does not have sfdisk installed?
In any case, try adding "--logfile </path/to/some/logfilename>" as parameter and after the script stops, inspec the content of that log file to see if it helps you find the cause of the error.
The difference between my original usbimg2disk.sh and the version maintained by Pat in Slackware, is that my script extracts the initrd image, changes a few things so that the USB stick is automatically mounted on boot and then selected as the default location from which to install the packages, and then re-creates the initrd image.
If instead of the version from Eric's website you want to use the version included in Slackware's usb_and_pxe_installer directory, and you'd like to boot a machine with an EFI firmware, apply attached patch first.
Caveat emptor: I'm not telling that will solve your issue, just an off-topic reminder.
Last edited by Didier Spaier; 06-08-2014 at 09:58 AM.
If instead of the version from Eric's website you want to use the version included in Slackware's usb_and_pxe_installer directory, and you'd like to boot a machine with an EFI firmware, apply attached patch first.
Caveat emptor: I'm not telling that will solve your issue, just an off-topic reminder.
Care to tell us why this is a good thing? What will it fix? Why just change these lines and not take care of the other commands relating to the /syslinux directory in the USB image?
I do not own any hardware with UEFI so I can not test what the effect of your modification is.
@ Alien BoB. That puts the content of the initrd directly at the root of the tree instead of in the /syslinux directory IIRC, that is needed for EFI booting. I have no EFI firmware either, but tried in a VM.
PS To make sure, I'll apply the patch and test again.
Last edited by Didier Spaier; 06-08-2014 at 10:33 AM.
Reason: PS added.
This hardware is not that old, but it is also not EFI. Going to try the version from the official release and see if I get better results. Will report back. Thank you all for the help.
Ah! Found the culprit. This thumb drive was previously a Fedora 20 Live Disc. When looking at the logfile (thanks AlienBOB for pointing that out), I found that sfdisk did not support GPT and thus the reason why it would fail to make the thumb drive bootable. What I had to do was to use gdisk, and do the following:
Code:
gdisk /dev/sdX
Select 2
Select x
Select z
Select Y to the next two questions
That's it! The usbimg2disk.sh works correctly. I tested using the one from Slackware (which was failing with the same error). I am assuming that it will work for the one provided by AlienBOB.
Hopefully this will help someone else! Thank you all for your help.
If you're trying to make a complete bootable USB installer for a non-UEFI machine, just dd or cat the appropriate ISO image to the stick. The ones for 14.1 will boot directly from a stick just fine.
If you're trying to make a complete bootable USB installer for a non-UEFI machine, just dd or cat the appropriate ISO image to the stick. The ones for 14.1 will boot directly from a stick just fine.
Thank you! That is good to know. Last time I had tried that, it didn't work.
If you're trying to make a complete bootable USB installer for a non-UEFI machine, just dd or cat the appropriate ISO image to the stick. The ones for 14.1 will boot directly from a stick just fine.
stormtracknole, I need to think that over. GPT formatted USB sticks should be properly handled.
I ran into this very same problem, and I think I found the cause of the issue. You see, at lines 94 and 95 of the “usbimg2disk.sh” script (as found on the Slackware64 14.1 DVD), the following snippet is to be found:
Code:
# Wipe the MBR:
dd if=/dev/zero of=$TOWIPE bs=512 count=1
The thing is, this will (as the comment says) wipe the MBR—but it will leave the GPT data structures on the disk (or stick) intact. Any software that knows about GPT will, then, assume (and correctly, at that) that the disk is still partitioned using a GPT scheme, but with a corrupted MBR. Indeed, the “gdisk” utility will inform you that it:
Code:
Found valid GPT with corrupt MBR; using GPT and will write new protective MBR on save.
Non-GPT utilities (e.g., “fdisk”), assuming that they are recent enough to at least detect the presence of GPT data structures, will tell you that they don’t support GPT, and that you should use other utilities, such as “gdisk”, to operate on the disk partition table.
As stormtracknole noted, you can use “gdisk” to zap the GPT data structures, and the disk will subsequently be properly handled as an MBR-partitioned disk.
Otherwise, if you don’t want to, or cannot, use “gdisk”, then you should zap not only the MBR, but also the GPT tables—both at the beginning and at the end of the disk. Instead of wiping just the MBR (i.e., the first sector of the disk), you should zap the first 34 sectors—i.e.:
Code:
# Wipe the MBR and the main GPT tables:
dd if=/dev/zero of=$TOWIPE bs=512 count=34
Then, to wipe the backup copy of the GPT tables, you should zap the final 34 sectors of the disk as well:
(where NUMBER_OF_SECTORS represents the total number of sectors on the disk).
(In fact, the backup GPT tables do not include a copy of the MBR, and occupy not 34 sectors, but one sector less, so you could replace both occurrences of the number “34” with “33” in that last command. Also, it is probably sufficient to zap only the MBR and both copies of the GPT Header—i.e., the first two sectors, and the single last sector—but I haven’t actually tried that.)
Also, I’m assuming that the GPT partition table has the default size, which allows for 128 partitions, recording four partitions per 512-byte sector—which works out to 32 sectors. The beginning of the disk has 1 sector for the “Protective” MBR, one sector for the GPT Header, plus 32 sectors for the GPT partition table; the end of the disk has only the 32 sectors for the GPT backup partition table, plus the GPT Header. The 32-sector, 128-partition size of the partition table is, however, not hard-wired; in principle, it could be made larger—though, for current-generation disks, 128 partitions should be more than sufficient. If you really want to be sure about the GPT table size, you will have to look into the GPT Header—i.e., the second sector of the disk—which, somewhere, includes a record of these values.)
EDIT:
There appears to exist an “sgdisk” utility, which can zap the MBR and GPT structures for you, as follows:
Code:
sgdisk --zap-all ${TOWIPE}
(provided, of course, that you have access to the utility).
The script in Slackware-14.1/usb-and-pxe-installers, is worng in the line 151.
Replace the line
/sbin/sfdisk -A $USBDRV 1
by
/sbin/sfdisk -a $USBDRV 1
The -A is append a partition and sfdisk stay way for input commands.
Looks like the developer changed the meaning of a parameter here. How stupid can you get?
On Slackware 13.37:
Code:
-A number
Make the indicated partition(s) active, and all others inactive.
On Slackware 14.1:
Code:
-a, --activate device [partition-number...]
Switch on the bootable flag. If no partition-number is speci-
fied, then all partitions with an enabled flag are listed.
OPTIONS
-A, --append
Don't create a new partition table, but only append the speci-
fied partitions.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.