MikeCoder
Posts: 53
Joined: Fri Jan 24, 2020 12:05 am

Extract a OS image from NOOBS

Tue Jun 30, 2020 2:25 am

Hello!
When I started doing raspberry pi, I used noobs and installed rpiOS. Its been 3 years and I want to move the OS from a 32gb card to a 8 gig one. But it is filesystem expanded so I believe the way to cram it in is to remove all the noobs stuff and just have the rpiOS left. I think there is enough space to fit it in if some programs are removed.

Cheers!

GlowInTheDark
Posts: 1066
Joined: Sat Nov 09, 2019 12:14 pm

Re: Extract a OS image from NOOBS

Tue Jun 30, 2020 6:31 am

GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

Loves Linux; loves to dance.

User avatar
B.Goode
Posts: 10725
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Extract a OS image from NOOBS

Tue Jun 30, 2020 6:53 am

MikeCoder wrote:
Tue Jun 30, 2020 2:25 am
Hello!
When I started doing raspberry pi, I used noobs and installed rpiOS. Its been 3 years and I want to move the OS from a 32gb card to a 8 gig one. But it is filesystem expanded so I believe the way to cram it in is to remove all the noobs stuff and just have the rpiOS left. I think there is enough space to fit it in if some programs are removed.

Cheers!


" I believe the way to cram it in is to remove all the noobs stuff and just have the rpiOS left."

You are likely to find that you are unable to boot the remaining Operating System. Things are more complicated than that..

Detailed documentation here - https://github.com/raspberrypi/noobs/wi ... -explained



" Its been 3 years and I want to move the OS "

A lot of improvements, including security patches, have been made in the intervening period. The underlying operating system has been twice superceded, from Jessie to Stretch in August 2017, and from Stretch to Buster in June 2019.



My alternative approach would be to do a fresh installation of the current RasPiOS Buster Operating System and then use a usb microSD card reader to rescue any vital work from the previous card.

RonR
Posts: 1682
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Extract a OS image from NOOBS

Tue Jun 30, 2020 7:26 am

MikeCoder wrote:
Tue Jun 30, 2020 2:25 am
When I started doing raspberry pi, I used noobs and installed rpiOS. Its been 3 years and I want to move the OS from a 32gb card to a 8 gig one. But it is filesystem expanded so I believe the way to cram it in is to remove all the noobs stuff and just have the rpiOS left. I think there is enough space to fit it in if some programs are removed.

noobs2img will extract the RaspiOS system in NOOBS to a stand-alone image file that can be written to another SD card or USB device.

MikeCoder
Posts: 53
Joined: Fri Jan 24, 2020 12:05 am

Re: Extract a OS image from NOOBS

Tue Jun 30, 2020 6:51 pm

RonR wrote:
Tue Jun 30, 2020 7:26 am
MikeCoder wrote:
Tue Jun 30, 2020 2:25 am
When I started doing raspberry pi, I used noobs and installed rpiOS. Its been 3 years and I want to move the OS from a 32gb card to a 8 gig one. But it is filesystem expanded so I believe the way to cram it in is to remove all the noobs stuff and just have the rpiOS left. I think there is enough space to fit it in if some programs are removed.

noobs2img will extract the RaspiOS system in NOOBS to a stand-alone image file that can be written to another SD card or USB device.
I had a look at noobs2img, and downloaded it. I am confused on how to run it, since it is a img file.

RonR
Posts: 1682
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Extract a OS image from NOOBS

Tue Jun 30, 2020 6:59 pm

MikeCoder wrote:
Tue Jun 30, 2020 6:51 pm
I had a look at noobs2img, and downloaded it. I am confused on how to run it, since it is a img file.

noobs2img is BASH script file (you can look at its contents with nano).

Simply make it executable (chmod +x noobs2img) and run it (sudo ./noobs2img).

MikeCoder
Posts: 53
Joined: Fri Jan 24, 2020 12:05 am

Re: Extract a OS image from NOOBS

Tue Jun 30, 2020 7:04 pm

Uhh, I have windows... I'm pretty sure I need a linux distro to do that.

RonR
Posts: 1682
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Extract a OS image from NOOBS

Tue Jun 30, 2020 7:11 pm

MikeCoder wrote:
Tue Jun 30, 2020 7:04 pm
Uhh, I have windows... I'm pretty sure I need a linux distro to do that.

You do it on your Raspberry Pi that's running NOOBS.

fbe
Posts: 648
Joined: Thu Aug 17, 2017 9:08 pm

Re: Extract a OS image from NOOBS

Tue Jun 30, 2020 7:15 pm

Raspbian/Raspberry Pi OS is a Linux distro.

MikeCoder
Posts: 53
Joined: Fri Jan 24, 2020 12:05 am

Re: Extract a OS image from NOOBS

Tue Jun 30, 2020 7:55 pm

Ok I got it running, but what does the "Image file to create?" mean? It says it has to begin with /mnt or /media.

RonR
Posts: 1682
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Extract a OS image from NOOBS

Tue Jun 30, 2020 8:43 pm

MikeCoder wrote:
Tue Jun 30, 2020 7:55 pm
Ok I got it running, but what does the "Image file to create?" mean? It says it has to begin with /mnt or /media.

That's the image file you want to create containing the RaspiOS that you're extracting from NOOBS.

Typically, you mount a USB flash drive on /media or /mnt and create the image file there, for example: /mnt/raspios.img

When it completes, you then write that image file to a new SD card or USB device using Etcher (or the image writer of your choice).

fbe
Posts: 648
Joined: Thu Aug 17, 2017 9:08 pm

Re: Extract a OS image from NOOBS

Tue Jun 30, 2020 8:50 pm

If you have a 32GB SD card and expect that your backup fits on a 8GB SD card, chances are good that you have enough space left on your 32GB SD card to store your backup image without mounting an additional drive.

Please check the output of

Code: Select all

df

RonR
Posts: 1682
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Extract a OS image from NOOBS

Tue Jun 30, 2020 9:07 pm

@MikeCoder,

When you get the 'Image ROOT filesystem size (MB)' prompt, enter 0 to determine the minimum size, and use that minimum size.

MikeCoder
Posts: 53
Joined: Fri Jan 24, 2020 12:05 am

Re: Extract a OS image from NOOBS

Tue Jun 30, 2020 9:20 pm

Ok nv I got it on a usb drive I had. After I run the program and the file is made, do I wait for something to happen on the terminal windows since the program is still running?

RonR
Posts: 1682
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Extract a OS image from NOOBS

Tue Jun 30, 2020 9:29 pm

MikeCoder wrote:
Tue Jun 30, 2020 9:20 pm
Ok nv I got it on a usb drive I had. After I run the program and the file is made, do I wait for something to happen on the terminal windows since the program is still running?

When noobs2img completes, simply write the image file it created to a new SD card using Etcher. The new SD card should boot and run (be patient the first time as it auto-expands and reboots.

MikeCoder
Posts: 53
Joined: Fri Jan 24, 2020 12:05 am

Re: Extract a OS image from NOOBS

Tue Jun 30, 2020 9:43 pm

So currently it is on "Starting full backup (for incremental backups, run: ./noobs2img /media/pi/LARRY_32GB/TUC OS 32-bit rpiOS v2.5.img)" When the program completes, will it return to the command prompt?

RonR
Posts: 1682
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Extract a OS image from NOOBS

Tue Jun 30, 2020 9:48 pm

MikeCoder wrote:
Tue Jun 30, 2020 9:43 pm
So currently it is on "Starting full backup (for incremental backups, run: ./noobs2img /media/pi/LARRY_32GB/TUC OS 32-bit rpiOS v2.5.img)" When the program completes, will it return to the command prompt?

Yes. Depending on the speeds of the source and destination media and the amount of data to back up, it can take a while.

MikeCoder
Posts: 53
Joined: Fri Jan 24, 2020 12:05 am

Re: Extract a OS image from NOOBS

Wed Jul 01, 2020 12:56 am

Code: Select all

file has vanished: "/var/lib/dpkg/info/fonts-croscore.md5sums"
file has vanished: "/var/lib/dpkg/info/fonts-croscore.postinst"
file has vanished: "/var/lib/dpkg/info/fonts-croscore.preinst"
file has vanished: "/var/lib/dpkg/info/fonts-croscore.prerm"
file has vanished: "/var/lib/dpkg/info/libirrlicht1.8:armhf.list"
file has vanished: "/var/lib/dpkg/info/libirrlicht1.8:armhf.md5sums"
file has vanished: "/var/lib/dpkg/info/libirrlicht1.8:armhf.shlibs"
file has vanished: "/var/lib/dpkg/info/libirrlicht1.8:armhf.triggers"
file has vanished: "/var/lib/dpkg/info/libleveldb1d:armhf.list"
file has vanished: "/var/lib/dpkg/info/libleveldb1d:armhf.md5sums"
file has vanished: "/var/lib/dpkg/info/libleveldb1d:armhf.shlibs"
file has vanished: "/var/lib/dpkg/info/libleveldb1d:armhf.triggers"
file has vanished: "/var/lib/dpkg/info/libpq5:armhf.list"
file has vanished: "/var/lib/dpkg/info/libpq5:armhf.md5sums"
file has vanished: "/var/lib/dpkg/info/libpq5:armhf.shlibs"
file has vanished: "/var/lib/dpkg/info/libpq5:armhf.symbols"
file has vanished: "/var/lib/dpkg/info/libpq5:armhf.triggers"
file has vanished: "/var/lib/dpkg/info/minetest-data.list"
file has vanished: "/var/lib/dpkg/info/minetest-data.md5sums"
file has vanished: "/var/lib/dpkg/info/python-olefile.list"
file has vanished: "/var/lib/dpkg/info/python-olefile.md5sums"
file has vanished: "/var/lib/dpkg/info/python-olefile.postinst"
file has vanished: "/var/lib/dpkg/info/python-olefile.prerm"
file has vanished: "/var/lib/dpkg/info/python-pil:armhf.list"
file has vanished: "/var/lib/dpkg/info/python-pil:armhf.md5sums"
file has vanished: "/var/lib/dpkg/info/python-pil:armhf.postinst"
file has vanished: "/var/lib/dpkg/info/python-pil:armhf.prerm"
rsync warning: some files vanished before they could be transferred (code 24) at main.c(1207) [sender=3.1.3]

RonR
Posts: 1682
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Extract a OS image from NOOBS

Wed Jul 01, 2020 1:01 am

MikeCoder wrote:
Wed Jul 01, 2020 12:56 am

Code: Select all

file has vanished: "/var/lib/dpkg/info/fonts-croscore.md5sums"
file has vanished: "/var/lib/dpkg/info/fonts-croscore.postinst"
file has vanished: "/var/lib/dpkg/info/fonts-croscore.preinst"
file has vanished: "/var/lib/dpkg/info/fonts-croscore.prerm"
file has vanished: "/var/lib/dpkg/info/libirrlicht1.8:armhf.list"
file has vanished: "/var/lib/dpkg/info/libirrlicht1.8:armhf.md5sums"
file has vanished: "/var/lib/dpkg/info/libirrlicht1.8:armhf.shlibs"
file has vanished: "/var/lib/dpkg/info/libirrlicht1.8:armhf.triggers"
file has vanished: "/var/lib/dpkg/info/libleveldb1d:armhf.list"
file has vanished: "/var/lib/dpkg/info/libleveldb1d:armhf.md5sums"
file has vanished: "/var/lib/dpkg/info/libleveldb1d:armhf.shlibs"
file has vanished: "/var/lib/dpkg/info/libleveldb1d:armhf.triggers"
file has vanished: "/var/lib/dpkg/info/libpq5:armhf.list"
file has vanished: "/var/lib/dpkg/info/libpq5:armhf.md5sums"
file has vanished: "/var/lib/dpkg/info/libpq5:armhf.shlibs"
file has vanished: "/var/lib/dpkg/info/libpq5:armhf.symbols"
file has vanished: "/var/lib/dpkg/info/libpq5:armhf.triggers"
file has vanished: "/var/lib/dpkg/info/minetest-data.list"
file has vanished: "/var/lib/dpkg/info/minetest-data.md5sums"
file has vanished: "/var/lib/dpkg/info/python-olefile.list"
file has vanished: "/var/lib/dpkg/info/python-olefile.md5sums"
file has vanished: "/var/lib/dpkg/info/python-olefile.postinst"
file has vanished: "/var/lib/dpkg/info/python-olefile.prerm"
file has vanished: "/var/lib/dpkg/info/python-pil:armhf.list"
file has vanished: "/var/lib/dpkg/info/python-pil:armhf.md5sums"
file has vanished: "/var/lib/dpkg/info/python-pil:armhf.postinst"
file has vanished: "/var/lib/dpkg/info/python-pil:armhf.prerm"
rsync warning: some files vanished before they could be transferred (code 24) at main.c(1207) [sender=3.1.3]

That's most likely not a problem. It can happen that Linux does some automatic file deletions while rsync is copying files. Don't let it stop you.

MikeCoder
Posts: 53
Joined: Fri Jan 24, 2020 12:05 am

Re: Extract a OS image from NOOBS

Wed Jul 01, 2020 2:14 pm

One problem with the image is that is boots twice before it opens to the desktop.

GlowInTheDark
Posts: 1066
Joined: Sat Nov 09, 2019 12:14 pm

Re: Extract a OS image from NOOBS

Wed Jul 01, 2020 2:46 pm

MikeCoder wrote:
Wed Jul 01, 2020 2:14 pm
One problem with the image is that is boots twice before it opens to the desktop.
If is doing that, then it is still NOOBS (or PINN). It sounds like this 'noobs2image" thingamajig just makes an image (however you define that), but doesn't actually "de-NOOBS-ify" it.

If you had followed my advice upthread, all would be well.
GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

Loves Linux; loves to dance.

RonR
Posts: 1682
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Extract a OS image from NOOBS

Wed Jul 01, 2020 5:15 pm

MikeCoder wrote:
Wed Jul 01, 2020 2:14 pm
One problem with the image is that is boots twice before it opens to the desktop.

The first time, it will boot twice. The first is to auto-resize in order to use all available space. Subsequent starts will only boot once.

RonR
Posts: 1682
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Extract a OS image from NOOBS

Wed Jul 01, 2020 5:44 pm

GlowInTheDark wrote:
Wed Jul 01, 2020 2:46 pm
MikeCoder wrote:
Wed Jul 01, 2020 2:14 pm
One problem with the image is that is boots twice before it opens to the desktop.
If is doing that, then it is still NOOBS (or PINN). It sounds like this 'noobs2image" thingamajig just makes an image (however you define that), but doesn't actually "de-NOOBS-ify" it.

noobs2img uses rsync to copy the running BOOT/ROOT partitions to a standard raw mage file. There are no remnants of NOOBS or PINN contained in the resulting image file. The first time the image file is run, it auto-resizes which requires a reboot.

noobs2img is a BASH script. Take a look at it and if you find a problem with any of its logic, please let me know.

Return to “Beginners”