DOS bootsector needed for NOOBS install?

Hi all,

sorry, if this has been asked before. But,

I am now working with some Raspberries for around one year, and now I am confused about the following:

I can download NOOBS 1.4.x as a zip ball, and on a Linux machine, it is always easy to install the image on a brandnew SD card. These cards are always formatted with MS DOS VFAT32, and you just have to mount the relevant partition, cd to where it is mounted, and extract the whole content of the zip archive to it.

After that you can put the SD card into the Rapsberry, boot from it and run the setup procedure.

Not so, if you take a used SD card and format it to again have a VFAT32 filesystem on it ( I do something like "mkdosfs -F 32 /dev/sdb1" ).

A card which you have formatted this way can be used in any MP3 player or camera, but when trying to boot your Raspberry from this card, this attempt will always fail.

So, there seems to be something different. I just don't know, what exactly is missing when formatting a used card.

Does there have to be an "MS DOS master boot record" written to it?

I know that those cards can be purchased "ready-to-use", but I'd like to understand, what's going on here.

Thanks for info, best regards,

Markus

--
Please reply to group only. 
For private email please use http://www.dipl-ing-kessler.de/email.htm
Reply to
Markus R. Kessler
Loading thread data ...

Hi all,

sorry, if this has been asked before. But,

I am now working with some Raspberries for around one year, and now I am confused about the following:

I can download NOOBS 1.4.x as a zip ball, and on a Linux machine, it is always easy to install the image on a brandnew SD card. These cards are always formatted with MS DOS VFAT32, and you just have to mount the relevant partition, cd to where it is mounted, and extract the whole content of the zip archive to it.

After that you can put the SD card into the Rapsberry, boot from it and run the setup procedure.

Not so, if you take a used SD card and format it to again have a VFAT32 filesystem on it ( I do something like "mkdosfs -F 32 /dev/sdb1" ).

A card which you have formatted this way can be used in any MP3 player or camera, but when trying to boot your Raspberry from this card, this attempt will always fail.

So, there seems to be something different. I just don't know, what exactly is missing when formatting a used card.

Does there have to be an "MS DOS master boot record" written to it?

I know that those cards can be purchased "ready-to-use", but I'd like to understand, what's going on here.

Thanks for info, best regards,

Markus

--
Please reply to group only. 
For private email please use http://www.dipl-ing-kessler.de/email.htm
Reply to
Markus R. Kessler

The first level booting from SD is done by a ROM inside the BCM2835. Unlike the rest of the bootloader stack, this part is fixed in every chip and doesn't change. It's also very minimal - for instance it doesn't read the long filenames of the FAT partition, only the MICROS~1.TXT 8.3 names (I discovered this when I managed to get the 8.3 name in lower case and it wouldn't boot).

It doesn't use the MBR boot sector, but I wouldn't be surprised if there was some other problem with the format due to the simplicity of the boot ROM.

Theo

Reply to
Theo Markettos

I don't know what's going on either. I have seen that there can be issues if the partition has a specific label, but the formatter will overwrite that (won't it?).

I've just taken a card that had NOOBS on it and formatted it using the exact command you gave. I then unzipped the noobs files onto it (unzip NOOBS_v1_4_1.zip -d /media/sdb1/). I put it in a Pi and it booted and NOOBS is installing.

Once that is complete I will do the same again (repartitioning the card to make partition 1 the full size of the card again).

I wonder if there was something odd about the partitioning? What does fdisk -l /dev/sdb show for the card that won't boot?

Dom

Reply to
Dom

But what about the partition structure? You need to set that with "fdisk" before formatting the partition(s).

An unused card will usually have just one large FAT32 partition, but a card that has Raspbian configured (say) will have a small FAT32 partition and a large ext4 partition.

To place a Raspbian image on a card, you just "dd" the image to the whole card, usually /dev/sdb (notice that's not /dev/sdb1) and the partitions will be part of the image. For NOOBS, you need to re-partition the card with "fdisk" (google for how to use it) so that it has a single "W95 FAT32 (LBA)" partition occupying the whole card, then you format the partition as a vfat filesystem.

Reply to
Dave Farrance

And regarding your question about an "MS DOS master boot record": No, it's not needed. The Pi's SOC is smart enough to understand the vfat filesystem and it looks inside that for the file bootcode.bin, which it loads and runs. bootcode.bin will be supplied as the initial bootloader file with any OS intended for the Pi.

Reply to
Dave Farrance

But be aware it has to be VFAT...

--
the biggest threat to humanity comes from socialism, which has utterly  
diverted our attention away from what really matters to our existential  
 Click to see the full signature
Reply to
The Natural Philosopher

Am Fri, 20 Nov 2015 10:15:22 +0000 schrieb The Natural Philosopher:

Hi, thanks for the info -- I was just about to test it with EXT2 :-)

BR,

Markus

--
Please reply to group only. 
For private email please use http://www.dipl-ing-kessler.de/email.htm
Reply to
Markus R. Kessler

Am Fri, 20 Nov 2015 07:14:18 +0000 schrieb Dom:

Hi Dom, hi all,

seems that some Raspberries (currently I am working on an older one with

2 USBs) need a volume name for the SD card.

So the "-n" should be used in addition: mkdosfs -n 'RASPBERRY' /dev/mmcblk0

Now tbe box is booting, and I remember, that every SD card and every memory stick I ever used, had a more or less idiotic name, but it was never empty. Funny... :-)

Best regards,

Markus

--
Please reply to group only. 
For private email please use http://www.dipl-ing-kessler.de/email.htm
Reply to
Markus R. Kessler

I've got one of the earliest Pis and it doesn't require a volume name.

A volume name is _useful_ in that linux will mount it at /media//

...so you're less likely to have "finger trouble" in placing the boot files into the correct partition, but the Pi itself shouldn't need it.

Reply to
Dave Farrance

Am Fri, 20 Nov 2015 18:50:16 +0000 schrieb Dave Farrance:

Well, it's working, but I'll erase it again and play a little to get even more errors. So I can try to find the "root cause".

But now there's one more challenge:

Installation of most of these OS images require an *ETH*-based network connection. But currently I have only WLAN for my machines in that flat.

In most cases this is sufficient, but Raspi cannot do the base install via WiFi. -- Maybe, I could use one of my boxes to do some kind of IP- forwarding, but that's not this trivial.

Any idea?

Thanks, best regards,

Markus

--
Please reply to group only. 
For private email please use http://www.dipl-ing-kessler.de/email.htm
Reply to
Markus R. Kessler

But did you use NOOBS for the install? There is some issue with the NOOBS installer and volume names on the FAT32 partition. I haven't encountered it yet (my test with reformatting and reinstalling ran fine), but I have seen others mention it.

Maybe the issue has been fixed in a recent NOOBS release. It shouldn't be hard to do really.

Dom

Reply to
Dom

I've found what I think is the relevant thread:

formatting link

It seems to be that sometimes (depending on the utility used to set the partitions -- gparted seems to be the main culprit) after copying the NOOBS files to the card, when the NOOBS installer then tries to repartition the card, parted complains that the number of FAT clusters marked as available does not match the figure for available clusters that is stored in the fsinfo sector. Setting the volume label (and other random things were found to work) causes the number to be recalculated to the correct value (although the volume label itself was something of a red herring).

Other people there mention that the problem can be triggered by failure to unmount the filesystem (with the safe eject) before removing the card from the machine used to copy the NOOBs files.

Dunno if that's relevant to the case in this thread.

Reply to
Dave Farrance

There are some posts on the raspberry pi forums

formatting link
- use a decent search engine to find them) about adding other OS images to a NOOBS card now that the default image only contains Raspbian.

Reply to
Dom

Den 2015-11-19 kl. 23:12, skrev Markus R. Kessler:

It must be a bootable W95 FAT32 (LBA) partition. This is from my guide at

formatting link
, but I add some questions at the end:

##Install##

First you unpack NOOBS on an SD-card. You can use Windows or Mac OS X for this, but below is shown for Raspbian Linux.

Skip to next heading if you have a new, blank SD-card.

Use this to list partitions:

sudo fdisk -l

Use Parted or FDisk to remove all partitions from the SD-card you want to format and create a new, bootable W95 FAT32 (LBA) partition, see [this guide]

formatting link
or check this example:

$ umount /dev/sda1 # Change sda1 to the device you will use. $ sudo fdisk /dev/sda

Command (m for help): d Partition number (1-6): 1

Command (m for help): d Partition number (1-6): 2

Command (m for help): d Selected partition 3

Command (m for help): d No partition is defined yet!

Command (m for help): p

Disk /dev/sda: 15.9 GB, 15931539456 bytes 4 heads, 16 sectors/track, 486192 cylinders, total 31116288 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000825fe

Device Boot Start End Blocks Id System

Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p Partition number (1-4, default 1): 1 Using default value 1 First sector (2048-31116287, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-31116287, default

31116287): Using default value 31116287

Command (m for help): p

Disk /dev/sda: 15.9 GB, 15931539456 bytes 4 heads, 16 sectors/track, 486192 cylinders, total 31116288 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000825fe

Device Boot Start End Blocks Id System /dev/sda1 2048 31116287 15557120 83 Linux

Command (m for help): t Selected partition 1 Hex code (type L to list codes): l

0 Empty 1 FAT12 2 XENIX root 39 Plan 9 83 Linux 3 XENIX usr 4 FAT16
Reply to
M.O.B. i L.

It just has to be the first FAT32 partition on the card. Partition number 1. It doesn't have to be bootable - the Pi ignores that flag. The Pi will also boot from FAT12 and FAT16, but they might not have enough capacity for NOOBS.

The partition doesn't even have to fill the card, it just needs to be big enough for the NOOBS install files with a bit in reserve. It gets resized anyway.

Dom

Reply to
Dom

"Some people may have problems getting their card to boot in the Raspberry Pi when wiped and re-partitioned like this. If you have that problem, simply make the new partition bootable using the a command."

formatting link

I had this problem and it was solved with the 'a' command in fdisk. I used 'c W95 FAT32 (LBA)' since these SD-cards had that originally.

How do you automate fdisk? Since I do this guide

formatting link
on many cards I would like to do it in a Bash-script or from Perl.

Reply to
M.O.B. i L.

actually using a pi as a router to connect a LAN interface to a wan "should" be very easy I don't have access to my Pi at present to test though, I suspect a wiser person will post the correct options before I get a chance to.

Reply to
Alister

Possibly you could send the key sequences though a pipe into fdisk using echo or cat. You could also use sfdisk, which can be fed a complete new partition table in that way.

Reply to
Dom

You could also use a HERE document, which works for any program that accepts commands, data, etc through stdin. Here's an example:

#!/bin/bash cat

Reply to
Martin Gregorie

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.