Power & Source of Big Ideas

Booting from a tiny disk

Moderators: chensy, FATechsupport

I am using the new NAS dock but not in the usual way. I'm using a NEO2 and so I put FriendlyArm's normal Ubuntu for NEO2 onto the SD.... and that worked fine.

I copied the operating system files over to the hard drive - and changed the file in the BOOT directory to point to the hard drive.

SO all is well, I have the hard drive running things, booting off the SD. I even have a display working on the I2c (connector in the NAS box) and I've changed the default debug serial to 1, so that I can use the serial connector on the NAS box.

All in all very successful - however, I have a 16GB SD going to waste and would like to boot off a 128MB SD. I have tried formatting the 128MB drive to FAT32 - and copying the contents of the boot directory into it - nope - won't boot. I even tried in Windows setting the status of that partition to active - still no difference. No matter what I do it just sits there and won't boot off the little SD.

Then I look at the WORKING SD with fdisk I see this.


Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 49152 253951 204800 100M 83 Linux
/dev/mmcblk0p2 253952 31116287 30862336 14.7G 83 Linux

Well that has me totally confused. I'm not very good with Linux but I thought the first partition was supposed to be bootable - and FAT32 so I could see it on Windows - yet it appears that is NOT the case....

Can someone put me out of my misery. How do I get the boot section onto a little SD?
Got a crazy idea for you.

Your 16gb working card has a partition map, a 100mb fat32 partition, and then a big stinking Linux partition.

The stuff you need should all be on the partition map and the 100mb partition. If you've set up your boot options correctly, it never accesses that Linux (ext4, probably) partition.

Sooooo.... Let's pop that sd card in another Linux box. It shows up as /dev/sdg, let's say.

Code: Select all

parted /dev/sdg print
Number Start End Size Type File system Flags
1 25.2MB 130MB 105MB primary fat16 2 130MB 7948MB 7818MB primary ext4


That was for my 8gb card. Yours should be similar, but bigger.
Next

Code: Select all

sudo dd if=/dev/sdg of=/tmp/sdcard.dd


We now have a full backup of the known working scared - partition map and both partitions.

Pull the 16gb card out, and pop the small one in. Should be the same drive letter, sdg again.

Code: Select all

sudo dd if=/tmp/sdcard.dd of=/dev/sdg


It will go along, and fail. But let's see what we get...

Code: Select all

parted /dev/sdg print


I'll bet it will be the same map of the drive. It got the partition map, the 100mb partition, and the smallest slice of the big one. If your boot setup really doesn't need that partition, you should be Ok. My only concern would be if the partition is offset, like mine. My partition starts at 25mb, so it could overrun your 128mb SD card.

Let me know if this works.

Who is online

In total there are 35 users online :: 0 registered, 0 hidden and 35 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 35 guests