Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: vltcl on December 10, 2020, 02:00:30 PM

Title: [Solved] Creating bootable USB without CD
Post by: vltcl on December 10, 2020, 02:00:30 PM
Hi,

I am new to tiny core and I don't have a CD reader.

Here is what I did:
- downloaded Core (11MB) from http://www.tinycorelinux.net/downloads.html
- mounted the .iso on my Fedora31 system with sudo mount -o loop /path/to/my-iso-image.iso /mnt/iso
- parted /dev/sdb "rm 1"
- parted /dev/sdb "mklabel msdos"
- parted /dev/sdb "mkpart primary ext4 1M 64M"
- parted /dev/sdb "set 1 boot"
- cp -r iso file to /mnt/sdb1 (where it was mounted)
- rebooted my laptop and switched to the USB in the BIOS

From there I have a black screen with a fixed cursor blinking and nothing else.

Maybe you can give me advice on what I did wrong or what I need to read up on, or better yet how to get it to work.
Title: Re: Creating bootable USB without CD
Post by: vltcl on December 10, 2020, 04:04:03 PM
- cp -r iso file to /mnt/sdb1 (where it was mounted)

although I did this later, initially I copied the contents of the iso (since I mounted it before) so specifically the boot folder.
Title: Re: Creating bootable USB without CD
Post by: jazzbiker on December 11, 2020, 01:50:10 AM
Hi, vltcl!

Downloaded .iso is already partitioned and has bootloader installed into system area, so no need to complicate things. As it is device, not partition, image, it must be written to /dev/sdX, not to mounted /mnt/sdXY. So, connect Your USB drive, don't mount any of its existing partitions, or if they are automounted in Fedora, unmount them. Let's assume that Your USB drive will be recognized as /dev/sdc. Then
Code: [Select]
sudo dd if="path-to-Core.iso" of=/dev/sdc bs=1M
sync

Have a nice Core!
Title: Re: Creating bootable USB without CD
Post by: polikuo on December 11, 2020, 03:10:13 AM
Welcome to TC forum.

Obviously, you need a bootloader to boot.

The common ones are GRUB2 and Syslinux.

If you're lazy, you can just dd the ISO to your USB.
(The USB should be bootable now, but the installation is incomplete)

Most motherboards should be able to boot into the system with that USB now.

Reboot the machine with the stick and see if it boots.

Then install the system with the official installer [tc-install] or [tc-install-GUI]
Code: [Select]
tce-load -wil tc-install
Unmount the USB then run
Code: [Select]
sudo tc-install
I recommend you choose the [net] option to fetch the required files from the internet.

BTW, What machine are you using ?
Title: Re: Creating bootable USB without CD
Post by: vltcl on December 11, 2020, 06:19:17 AM
Thank you for your answers.

Quote
Code: [Select]
sudo dd if="path-to-Core.iso" of=/dev/sdc bs=1M
sync

This results in the BIOS sending me directly back to the selection of devices to boot from (boot menu)

Quote
What machine are you using ?

Lenovo L450 Thinkpad on x86_64

Quote
If you're lazy, you can just dd the ISO to your USB.

What is the "not lazy" way? Same as jazzbiker's suggestion.

What is wrong? I was under the impression, that this would work.
Title: Re: Creating bootable USB without CD
Post by: jazzbiker on December 11, 2020, 09:08:03 AM
Hi, vltcl!

Probably, Your machine have UEFI. Please, search the forum about UEFI-related issues. Unfortunately there's no easy way, which can be explained in a few words and performed with a single troubleshooting recipe.  I think You may pay additional attention to PDP-8 posts, in my opinion he explored the UEFI on relatively fresh hardware very thoroughly and propose various workarounds and recipes.
Title: Re: Creating bootable USB without CD
Post by: vinceASPECT on December 11, 2020, 11:34:41 AM
hello  forum,

There is a win32 tool for that.

forget the exact name    usb2core   OR  tcl2usb

it may show up in  this forum. Sure that many know of it and can help.

thc

V
Title: Re: Creating bootable USB without CD
Post by: curaga on December 11, 2020, 02:05:59 PM
You can do a manual install from any linux system (instructions on the main page's install page, or wiki), or you could boot TC in a VM, attaching your usb stick, and doing the install in the VM.
Title: Re: Creating bootable USB without CD
Post by: NewUser on December 12, 2020, 02:06:24 AM
hello  forum,

There is a win32 tool for that.

forget the exact name    usb2core   OR  tcl2usb

it may show up in  this forum. Sure that many know of it and can help.

thc

V

That's core2usb1.6, if memory serves. Used it yesterday.
Title: Re: Creating bootable USB without CD
Post by: vltcl on December 12, 2020, 03:33:49 AM
Quote
Probably, Your machine have UEFI.
ls /sys gives: acpi dmi memmap
Since there is no efi, am I save to assume that I have BIOS?

Quote
There is a win32 tool for that.
I don't want to use third party tools, since I want to learn as much as possible from the process.
Besides that though: What exactly does it do? And how?

Quote
You can do a manual install from any linux system
So my steps are not supposed to work? Shouldn't I be able to boot from a dd'ed iso on USB and then install it from there?
Can you link an official link to tc-install.cz? I believe I will need that for your suggestion and can't find it anywhere on tinycorelinux.net.
Title: Re: Creating bootable USB without CD
Post by: curaga on December 12, 2020, 04:18:51 AM
dd is supposed to work, but your BIOS did not like it.

tc-install is for installing from TC. http://tinycorelinux.net/install_manual.html is the manual install process, which you can do from any Linux system.
Title: Re: Creating bootable USB without CD
Post by: Juanito on December 12, 2020, 04:24:58 AM
In addition, tc-install is provided by the CorePlus iso, so if you can boot the iso you can use it to install.

http://tinycorelinux.net/11.x/x86/release/CorePlus-11.1.iso
Title: Re: Creating bootable USB without CD
Post by: vltcl on December 14, 2020, 09:53:13 AM
Quote
http://tinycorelinux.net/install_manual.html is the manual install process, which you can do from any Linux system.
This clearly says: "It assumes that TC was booted from a liveCD and is already running on the target system with Internet access."

I downloaded the book though in which an actual description of a manual installation is given (Page 18).
I followed these steps:

- Since I assume, that I have BIOS and not UEFI, I chose the BIOS installation instructions.
- cfdisk (made a new partition on /dev/sdb)
- mkfs.ext2 (as suggested for USB's)
- mount /dev/sdb1 /mnt/tcusb
- mkdir boot
- mkdir tce
- cd /mnt/tcusb/boot
- wget http://repo.tinycorelinux.net/4.x/x86/release/distribution_files/core64.gz
- wget http://repo.tinycorelinux.net/4.x/x86/release/distribution_files/vmlinuz64
- following the instructions from the grub docs, I installed grub and ran
  grub-install /dev/sdb
- I then mounted the partition and added a grub.cfg with the contents from the
  tinycore book (I used the notation for grub 0.97)

Now when I boot, there is a message "Grub loading" and the machine immediately
reboots.

Whats wrong?
Title: Re: Creating bootable USB without CD
Post by: curaga on December 14, 2020, 12:40:33 PM
The install guide says so, because the pictures show our package manager, etc. The actions themselves are not distro specific.

Could it be you installed grub 2?
Title: Re: Creating bootable USB without CD
Post by: vltcl on December 14, 2020, 12:56:39 PM
Quote
Could it be you installed grub 2?

Yes, is this bad?
I changed the content of the .cfg file to the grub2 notation and I have the same result.
Also I can't just call update-grub becauase the command is not found. So I wrote the file myself with only the contents specified in the tinycore book.
I cannot simply run grub aswell because it is not installed via dnf (fedoras package manager).
Title: Re: Creating bootable USB without CD
Post by: vinceASPECT on December 14, 2020, 01:40:11 PM
hello forum,

seems to be what Juanto states and curaga forum member.

TCL operating system file, when "operating"...... offers a way to install itself via an "installer" to a usb pen.....so then the usb stick becomes (upon demand) a bootable tcl computer....when connected to a visual display dumb Laptop/terminal

how i remember it was........the tool is in the TCL desktop as an icon "installer". (when TCL operating system is running)

No idea how it achieves the above, (it is free though)


thx

v
Title: Re: Creating bootable USB without CD
Post by: patrikg on December 14, 2020, 03:27:30 PM
Maybe you have the program grub-mkconfig to do what you want, like this

Code: (bash) [Select]
sudo grub-mkconfig -o /boot/grub/grub.cfg
Title: Re: Creating bootable USB without CD
Post by: vltcl on December 15, 2020, 08:54:19 AM
Okay, unfortunately I have a problem installing grub-0.97 now. The error, when running ./configure is that "C compiler cannot create executables". In the log file it says that "crti.o cannot be found".
I still have to resolve this. Help is gladly appreciated.

But I am not sure if this is the right place to ask about this, so I tried the route with core2usb on my windows machine.
When I want to select my USB drive, the tool says: "target drive not empty". There is only one primary partition with exFAT on it, which I formatted through windows in order to make it visible to Windows with a drive letter.

Can someone help?
Title: Re: Creating bootable USB without CD
Post by: Rich on December 15, 2020, 09:19:39 AM
Hi vltcl
... the tool says: "target drive not empty". There is only one primary partition with exFAT on it, ...
Reformat your primary partition as either  FAT  or  FAT32.  Do not make it bootable. Do not make it an MSDOS startup disk.
Title: Re: Creating bootable USB without CD
Post by: vltcl on December 15, 2020, 09:34:02 AM
Quote
Reformat your primary partition as either  FAT  or  FAT32.  Do not make it bootable. Do not make it an MSDOS startup disk.

Tried both. 100MB partition. Tool still says "Selected drive is not empty" and in fact, there are 6kB (FAT), and 2kB(FAT32) written. I don't think, I can set a boot flag with the windows tool, neither make it an MSDOS startup disk. I just rightclicked the drive and selected "Format...". I don't get it. Why is this a problem?
Title: Re: Creating bootable USB without CD
Post by: Rich on December 15, 2020, 09:41:24 AM
Hi vltcl
Use the Windows partition utility to wipe all the partitions on the device. Then follow these instructions:
https://www.parkytowers.me.uk/thin/Linux/TinycorePDc2usb.shtml
Title: Re: Creating bootable USB without CD
Post by: vltcl on December 15, 2020, 09:52:56 AM
Thanks for the link Rich, this is exactly what I did. The tool still insists, that the drive is not empty.
I attached two screenshots; maybe I am missing something?
Title: Re: Creating bootable USB without CD
Post by: Rich on December 15, 2020, 10:27:46 AM
Hi vltcl
Since you have access to a Linux setup, we'll use it to blank your USB drive:
To find your device, run this:
Code: [Select]
tc@E310:~$ fdisk -l | grep -v loop | grep -i "Disk /dev/s"
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 sectors
tc@E310:~$
Then plug in your device and run it again:
Code: [Select]
tc@E310:~$ fdisk -l | grep -v loop | grep -i "Disk /dev/s"
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk /dev/sdg: 959.5 MiB, 1006108672 bytes, 1965056 sectors
tc@E310:~$
Your device will show up as an additional entry in the list,  /dev/sdg  in this example.

Code: [Select]
dd if=/dev/zero of=/dev/YourDevice bs=512 count=1Be extremely careful with this command. You will need to replace  /dev/YourDevice  with the  /dev/  assigned to your device.

Now go back to windows and format a  FAT  partition.
Title: Re: Creating bootable USB without CD
Post by: vltcl on December 15, 2020, 11:47:47 AM
After dd'ing I was asked to format the device.
I attached a screenshot of the formatting tool windows presents me.

I can't do FAT nor FAT32 (I could do it, when I created a partition with cfdisk with Type: W95 FAT32).
Title: Re: Creating bootable USB without CD
Post by: Rich on December 15, 2020, 11:52:00 AM
Hi vltcl
How about if you use the  Disk Management  tool:
https://www.howtogeek.com/101862/how-to-manage-partitions-on-windows-without-downloading-any-other-software/
Title: Re: Creating bootable USB without CD
Post by: vltcl on December 15, 2020, 12:28:13 PM
Unfortunately this doesn't work with drives that have more storage than 32GB in Windows (yes, very nice...).

In the Disk Management tool you don't have the option of FAT, FAT32 etc..

So I tried it by force with:

get-disk -Number 3 | New-Partition -UseMaximumSize -AssignDriveLetter | Format-Volume -FileSystem FAT32 -NewFileSystemLabel "tinycore" -Confirm:$false

in the powershell and finally got the error: "Format-Volume : Size Not Supported".

There is no way with this USB drive. So it is either third party software (which I abhore as a "solution") or its a smaller Drive.

Can I use a 16GB SD card attached to an USB to SD adapter? And still use core2usb or install tinycore that way?
Title: Re: Creating bootable USB without CD
Post by: Rich on December 15, 2020, 12:37:13 PM
Hi vltcl
So create the partition using  cfdisk  like you did before. Then have Windows format it.

I believe the  "Selected drive is not empty"  message really means that the drive has bootloader code in the  MBR.
If that message pops up again after formatting, you can wipe the booloader and still leave the partition(s) intact like this:
Code: [Select]
dd if=/dev/zero of=/dev/YourDevice bs=440 count=1Once again, be careful using this command. Make certain  of=  is pointing to your USB drive.
Title: Re: Creating bootable USB without CD
Post by: vinceASPECT on December 15, 2020, 01:15:06 PM
Rich, and forum,

THere is the "Rufus" tool that can be useful. It seems to really do the work proper.  (on drive types)

thx

v
Title: Re: Creating bootable USB without CD
Post by: Rich on December 15, 2020, 04:10:52 PM
Hi vltcl
I don't suppose windows leaves any little files behind when formatting? Possibly hidden? command.com, msdos.sys?
If you still get  "Selected drive is not empty"  after following the instructions from my last post, see if this command
(after mounting your device) produces any output besides . and ..
Code: [Select]
ls -la /mnt/YourDevice
Title: Re: Creating bootable USB without CD
Post by: NewUser on December 15, 2020, 11:37:49 PM
vltcl, I don't use xfat, I use fat32, but the situation may be the same. In Windows, try this: Open a cmd prompt, run as administrator. CD to the root of your USB drive, then issue this command. rd /s /q system then hit Tab. The shell should expand "System Volume Information". Hit enter to delete that file and all subdirectories (/s) /q outputs no information.

Then run core2usb. I don't know if core2usb supports exfat, but it's worth a try.

Good luck!
Title: Re: Creating bootable USB without CD
Post by: vltcl on December 16, 2020, 06:47:23 AM
THANK YOU.

This was waaaaay to obscure.
"ls -la /mnt/YourDevice" and NewUser's information was the key. In fact there was a whole directory called 'System Volume Information'. I deleted it and core2usb ran succesfully. It booted successfully and I am in tc@box:~$ now. Thank you all.
Title: Re: Creating bootable USB without CD
Post by: Rich on December 16, 2020, 09:35:53 AM
Hi vltcl
Glad to hear you resolved this. I was beginning to run out of ideas. Just curious, was  'System Volume Information'  a hidden
directory? Was it visible under Windows Explorer?
Title: Re: Creating bootable USB without CD
Post by: vltcl on December 16, 2020, 09:58:33 AM
It was hidden and it is installed on every drive, when formatting with windows
Title: Re: [Solved] Creating bootable USB without CD
Post by: Rich on December 16, 2020, 11:15:46 AM
Hi vltcl
I'm just going to provide a summary here.

I took a look at the source code for  core2usb.  It does not appear to check to see if a bootloader is already present. So
using the  dd  command to zero out part of the USB drive is completely unnecessary.

Some (all?) versions of Windows add hidden files/directories when formatting drives. core2usb.exe expects a drive to be
empty or it won't run.

To make hidden files visible in Windows Explorer so you cam delete them ...
Windows 8 and 10:
Click the "View" tab on File Explorers ribbon and click the "Hidden items" checkbox in the Show/hide section.

Windows 7:
Click the "Organize" button on Windows Explorers toolbar and select "Folder and search options".
Click the "View" tab at the top of the Folder Options window. Select "Show hidden files, folders, and drives". Click "OK"
to save the new setting.

"Creating bootable USB without CD":
Format your removable USB drive.
Delete all files and directories on your removable USB drive.
Use  core2usb.exe  to install Tinycore to your removable USB drive.
Title: Re: [Solved] Creating bootable USB without CD
Post by: vltcl on December 16, 2020, 03:24:28 PM
Yes, I would like to add, that if your USB drive has a storage space greater than 32GB you need to create a filesystem (FAT32 or FAT) from linux or use third party software on windows, because windows does not allow FAT32 or FAT for those kinds of devices. FAT and (as NewUser mentioned above) FAT32 seem to work with Core2USB. I have no knowledge about exFAT or NTFS and Core2USB, maybe someone can try that.

Quote
Windows 8 and 10: Click the "View" tab on File Explorers ribbon and click the "Hidden items" checkbox in the Show/hide section.
Also I am not sure about this way because I actually had this checkbox checked and I use Windows 10. So in case this doesn't work I recommend:

1. Press "Win+X" then press "a" - this opens up the powershell in admin mode
2. type "get-disk" to get a list of all connected drives
3. look for the desired drive and remember the number, then type "get-partition -number number"
4. see which letter the desired drive is assigned to and type "set-location driveletter:"
5. type "remove-item -recursive -force" and press tab - that way the hidden folder is suggested/revealed
6. press enter and repeat 4. until nothing is suggested
Title: Re: [Solved] Creating bootable USB without CD
Post by: NewUser on December 16, 2020, 11:15:09 PM
I collect USB thumb drives, a bad habit, many of them are larger than Windows 10 will format FAT32. I use a small program call GUIformat to handle the larger 128-256GB drives.