mfirth
Posts: 6
Joined: Tue Jul 03, 2012 1:36 pm

Convert NOOBS to disk image

Sat Jan 09, 2016 12:50 pm

Hi,

I've done some Googling, but not come up with an answer to this yet, so thought I would post here, in case there is an easy / quick link I've missed

Currently, the NOOBS zip assumes that users will have a virgin (or at least simple) SD card all formatted as FAT32 to extract it to.

However, a lot of the SD cards I have around are ones that have previously been used on the Pi or other embedded systems, and so have much more complicated partitioning layouts.

Is there a recommended way to convert NOOBS into a disk image that I could just "dd" to any SD card, the same way as the Raspbian disk images work?

I know that there are various tools to create disk images, but was wondering if someone already had a simple script / guide for doing it?

Thanks

Michael

drgeoff
Posts: 10676
Joined: Wed Jan 25, 2012 6:39 pm

Re: Convert NOOBS to disk image

Sat Jan 09, 2016 2:34 pm

It is simpler for beginners to follow the instructions to format the card using the SD Card Association's formatter. The critical bit of that is to set the 'Size Adjustment' option to 'on'. If the card is not larger than 32 Gbytes that restores it to a single partition suitable for NOOBS. Cards 32 Gbyte or larger require an additional step to change from exFAT.

QuietZone
Posts: 89
Joined: Sat Dec 05, 2015 7:13 pm

Re: Convert NOOBS to disk image

Sat Jan 09, 2016 3:57 pm

I'm assuming that OP is *not* a beginner and that he wants to do something interesting and fun (and, not incidentally, useful to *him* - if no one else).

So, in the grand Unix tradition, the answer is "Well, *you* could do that..."

If *I* were doing this, these are the steps I would follow:
  1. Download the latest version of NOOBS Lite
  2. Start with a freshly partitioned and formatted SD card - as small capacity as you can find. 500M will be more than plenty. Less than that if you can find it.
  3. unzip the NOOBS Lite zip file to the SD card
  4. cat /dev/sda > Noobs.img
Now in future, you can do: cat Noobs.img > /dev/sda
and you'll have a ready to go NOOBS Lite bootable card.
"If you haven't got anything nice to say about anybody come sit next to me." — Alice Roosevelt Longworth

User avatar
topguy
Posts: 6466
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Convert NOOBS to disk image

Sat Jan 09, 2016 5:03 pm

It can be done without an SD card also if you want to learn about loop-mounting disk-images.
( I'm assuming linux machine here, so this can be done on a RPi without extra SD-card reader )

Recipe something like this.
- Create a 500MB file with dd using /dev/zero as input.
- loop-mount the file as /dev/loop0
- Partition /dev/loop0 with parted or other tool of your choice.
- use kpartx to mount the partition(s) ( can maybe use kpartx for step 2 also )
- extract files from noobs-zip.
- unmount partitions and /dev/loop0
- image should now be ready to be written to SD-card.

QuietZone
Posts: 89
Joined: Sat Dec 05, 2015 7:13 pm

Re: Convert NOOBS to disk image

Sat Jan 09, 2016 5:13 pm

Yes, I was just thinking about that (almost as if by telepathy).

That, as you say, it could all be done without using an SD card at all, using loop files and such.
"If you haven't got anything nice to say about anybody come sit next to me." — Alice Roosevelt Longworth

User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Convert NOOBS to disk image

Sat Jan 09, 2016 10:50 pm

QuietZone wrote:I'm assuming that OP is *not* a beginner and that he wants to do something interesting and fun (and, not incidentally, useful to *him* - if no one else).
If the OP is "not" a beginner why's he bothering with NOOBS. It's much easier to move a plain Jessie system to have /boot on a small SDCard and the rootfs on a USB device.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

QuietZone
Posts: 89
Joined: Sat Dec 05, 2015 7:13 pm

Re: Convert NOOBS to disk image

Sat Jan 09, 2016 10:54 pm

Oh, Dougie, Dougie, Dougie...

Whatever will we do with you...?

Still banging away at NOOBS, like a voice in the wilderness...

(What a pity.. He used to be a fairly good programmer. Whatever can we do?)
"If you haven't got anything nice to say about anybody come sit next to me." — Alice Roosevelt Longworth

Navyscourge
Posts: 258
Joined: Sat Oct 24, 2015 1:50 pm

Re: Convert NOOBS to disk image

Sun Jan 10, 2016 10:18 am

The OP seems to want to do this to make it easier to reuse existing SD cards. The solution to this is to use the SDFormater or even fdisk on the Pi.

It would be better to use the latest version of NOOBS than an older one, but this would make sense to replicate a 'taylored' NOOBS config. The same would apply to a non-NOOBS image. Dougie's question is valid - I am not sure how experienced users would benefit by using NOOBS, apart from the ease of install (and I am not sure about that).

QuietZone
Posts: 89
Joined: Sat Dec 05, 2015 7:13 pm

Re: Convert NOOBS to disk image

Sun Jan 10, 2016 10:25 am

Dougie's question is valid - I am not sure how experienced users would benefit by using NOOBS, apart from the ease of install (and I am not sure about that).
If you (still) think this, then you just haven't thought it through.

Don't feel bad, though. You're not alone.
"If you haven't got anything nice to say about anybody come sit next to me." — Alice Roosevelt Longworth

User avatar
jojopi
Posts: 3233
Joined: Tue Oct 11, 2011 8:38 pm

Re: Convert NOOBS to disk image

Sun Jan 10, 2016 4:19 pm

drgeoff wrote:The critical bit of that is to set the 'Size Adjustment' option to 'on'.
Are you sure about this? What problem occurs if one does not tick that box?

I have never run the SD Association's Formatter tool, but I have read the documentation. What it says is that Format Size Adjustment will reduce the size of the partition to be created, so that it ends on a cylinder boundary. It recommends not doing this, unless your specific system requires it. Linux is never going to care about cylinder boundaries, which are completely fictitious, and I see no reason that NOOBS should care either.

drgeoff
Posts: 10676
Joined: Wed Jan 25, 2012 6:39 pm

Re: Convert NOOBS to disk image

Sun Jan 10, 2016 4:41 pm

jojopi wrote:
drgeoff wrote:The critical bit of that is to set the 'Size Adjustment' option to 'on'.
Are you sure about this? What problem occurs if one does not tick that box?

I have never run the SD Association's Formatter tool, but I have read the documentation. What it says is that Format Size Adjustment will reduce the size of the partition to be created, so that it ends on a cylinder boundary. It recommends not doing this, unless your specific system requires it. Linux is never going to care about cylinder boundaries, which are completely fictitious, and I see no reason that NOOBS should care either.
I refer you to https://www.raspberrypi.org/documentati ... n/noobs.md where it says:

"HOW TO FORMAT AN SD CARD AS FAT

Note: If you're formatting an SD (or micro SD) card that has a capacity over 32 GB (i.e. 64GB and above) then see the separate SDXC formatting instructions.

WINDOWS

For Windows users we recommend formatting your SD card using the SD Association's Formatting Tool, which can be downloaded from sdcard.org. You will need to set "FORMAT SIZE ADJUSTMENT" option to "ON" in the "Options" menu to ensure that the entire SD card volume is formatted, and not just a single partition."

QuietZone
Posts: 89
Joined: Sat Dec 05, 2015 7:13 pm

Re: Convert NOOBS to disk image

Sun Jan 10, 2016 4:47 pm

There's a lot I could say about this bit of canon - that is, about the SD formatting tool - but suffice to say that:

Just because something is written down - yes, even if it is written on the raspberrypi.org site - doesn't mean it is true.
"If you haven't got anything nice to say about anybody come sit next to me." — Alice Roosevelt Longworth

Navyscourge
Posts: 258
Joined: Sat Oct 24, 2015 1:50 pm

Re: Convert NOOBS to disk image

Sun Jan 10, 2016 8:45 pm

QuietZone wrote:If you (still) think this, then you just haven't thought it through
Care to enlighten me (and the rest of us)?

QuietZone
Posts: 89
Joined: Sat Dec 05, 2015 7:13 pm

Re: Convert NOOBS to disk image

Sun Jan 10, 2016 11:30 pm

Navyscourge wrote:
QuietZone wrote:If you (still) think this, then you just haven't thought it through
Care to enlighten me (and the rest of us)?
I just did!
"If you haven't got anything nice to say about anybody come sit next to me." — Alice Roosevelt Longworth

SonOfAMotherlessGoat
Posts: 690
Joined: Tue Jun 16, 2015 6:01 am

Re: Convert NOOBS to disk image

Mon Jan 11, 2016 12:57 am

QuietZone wrote:Oh, Dougie, Dougie, Dougie...

Whatever will we do with you...?

Still banging away at NOOBS, like a voice in the wilderness...

(What a pity.. He used to be a fairly good programmer. Whatever can we do?)
Joe Schmoe is that you?
Account Inactive

drgeoff
Posts: 10676
Joined: Wed Jan 25, 2012 6:39 pm

Re: Convert NOOBS to disk image

Mon Jan 11, 2016 1:10 pm

QuietZone wrote:There's a lot I could say about this bit of canon - that is, about the SD formatting tool - but suffice to say that:

Just because something is written down - yes, even if it is written on the raspberrypi.org site - doesn't mean it is true.
I did the experiment. Took a card with Raspbian on it and used SD Formatter without ticking the "Size Adjustment" option. The card then indeed had a single partition.

Out of interest I took the same card and used SD Formatter again, this time setting the option to "on". That gave a slightly different card size. These figures as reported by Windows are total size, not available size.
Adjustment off: 7,738,490,880
Adjustment on: 7,731,576,832

User avatar
topguy
Posts: 6466
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Convert NOOBS to disk image

Mon Jan 11, 2016 2:32 pm

I think the option does what is says in the documentation but it also has the sideeffect that it will reset information about physical-size stored in the partitioning table by earlier formatting. ( caused by using SDXC card in SDHC reader for example )

Most people will probably not need it, but its safer to say that it should be turned on to avoid problems for those that needs it.

QuietZone
Posts: 89
Joined: Sat Dec 05, 2015 7:13 pm

Re: Convert NOOBS to disk image

Mon Jan 11, 2016 2:37 pm

Most people will probably not need it, but its safer to say that it should be turned on to avoid problems for those that needs it.
The problem is that that sentence applies to the SD formatter in general. I.e., there's no real reason to ever use it in any case, but it so much a part of the religious canon that it is safer to say that it should be used. Heresy tends to be punished in every sphere.
"If you haven't got anything nice to say about anybody come sit next to me." — Alice Roosevelt Longworth

User avatar
topguy
Posts: 6466
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Convert NOOBS to disk image

Mon Jan 11, 2016 2:53 pm

QuietZone wrote:there's no real reason to ever use it in any case,
*ever*.. you are sure about that.. you have tested with all the SD cards that people might try to put into a Pi ?

I agree that you probably don't have to use the option just to reformat a standard NOOBS or Raspbian card, but If I was handed a random SD-card from someone to help with NOOBS installation I would turn the option on.

I think it's worth it if we can avoid a few "NOOBS don't fit on my SD-Card HEELP!!!" threads in the beginners forum. :)

User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Convert NOOBS to disk image

Tue Jan 12, 2016 6:22 am

SonOfAMotherlessGoat wrote:
QuietZone wrote:Oh, Dougie, Dougie, Dougie...

Whatever will we do with you...?

Still banging away at NOOBS, like a voice in the wilderness...

(What a pity.. He used to be a fairly good programmer. Whatever can we do?)
Joe Schmoe is that you?
If it isn't it's another annoying clone of Joe Schmoe.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Advanced users”