User avatar
DougieLawson
Posts: 36159
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

[Tutorial] How to move away from NOOBS

Tue Apr 29, 2014 2:15 pm

This process from five years ago has NOT been tested with Raspbian Stretch or NOOBS 3.0.0.
USE WITH EXTREME CAUTION.

There's been many postings on here about moving back from NOOBS to a single OS expanded to fill the whole SDCard.

I happened to have a SDCard with NOOBS/RaspBMC installed on it so I'll write up the technique using that. Note: this removes the NOOBS recovery system, it removes the NOOBS multi-boot options. When you're convinced that you will only ever use one operating system you can use this. It freed up 0.8GB on my 4GB SDCard (you may get more back depending what you've got on your NOOBS card).

1. We need to have somewhere to store the data while we're shuffling things.
2. We need to have an active Linux system (Ubuntu or Raspbian) to run the copies.
3. We need to understand a little bit about disk partitioning, dostools & ext{2,3,4} filesystem utilities.

Step 1

Mount the card we're working with in a USB SDCard reader and look at the disk partitions (these numbers will be important later). Note: the card appeared as /dev/sdb on my system. I'm going to use command line fdisk for everything. You could use your favourite partitioning tool.

sudo -i # we're going to run everything in a root shell
fdisk -l /dev/sdb
Disk /dev/sdb: 3974 MB, 3974103040 bytes
4 heads, 16 sectors/track, 121280 cylinders, total 7761920 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: 0x00070ae1

Device Boot Start End Blocks Id System
/dev/sdb1 8192 1585937 788873 e W95 FAT16 (LBA)
/dev/sdb2 1589248 7696383 3053568 85 Linux extended
/dev/sdb3 7696384 7761919 32768 83 Linux
/dev/sdb5 1597440 1761279 81920 c W95 FAT32 (LBA)
/dev/sdb6 1769472 7696383 2963456 83 Linux

I've highlighted the most important numbers from that display.

We need to multiply the 81920 block count by 2 (sector size is 512) add them to get the starting offset for the second partition.
So (81920 * 2) + 8192 gives us 172032 for partition 2.

So the SDCard has three physical partitions and two extend partitions (in partition 2).

/dev/sdb1 is the one that gets booted first by your RPi (it has the NOOBS bootstrap loader that boots /dev/sdb5)
/dev/sdb2 is the extended partition
/dev/sdb3 is the tiny NOOBS config partition
/dev/sdb5 is the FAT partition for the install OS (in my case that's RaspBMC)
/dev/sdb6 is the ext4 partition with the root filesystem for RaspBMC

Step 2

Copy the partitions we want to move.

dd if=/dev/sdb5 of=/media/usbHDD/raspbmc.sdb5.img bs=10M
dd if=/dev/sdb6 of=/media/usbHDD/raspbmc.sdb6.img bs=10M

Note: you may want to copy /dev/sdb1 & /dev/sdb3 (or the whole card /dev/sdb) so you can get back to the current status (if things go wrong). It depends what important data you may have stored on there and whether losing it forever would be a big deal. I put my copies on a hard disk.

Step 3

Re-write the partition table

This is the critical piece. Beyond this point assume your old data is gone from this SDCard.

Note: I'll annotate everything you have to enter in blue the syntax for fdisk is a bit arcane.

fdisk /dev/sdb

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

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

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

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

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk /dev/sdb: 3974 MB, 3974103040 bytes
4 heads, 16 sectors/track, 121280 cylinders, total 7761920 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: 0x00070ae1

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
First sector (2048-7761919, default 2048): 8192
Last sector, +sectors or +size{K,M,G} (8192-7761919, default 7761919): +81920K

Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (1-4, default 2): 2
First sector (2048-7761919, default 2048): 172032
Last sector, +sectors or +size{K,M,G} (172032-7761919, default 7761919):Just press [ENTER]
Using default value 7761919
Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): e
Changed system type of partition 1 to e (W95 FAT16 (LBA))

Command (m for help): p

Disk /dev/sdb: 3974 MB, 3974103040 bytes
4 heads, 16 sectors/track, 121280 cylinders, total 7761920 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: 0x00070ae1

Device Boot Start End Blocks Id System
/dev/sdb1 8192 172031 81920 e W95 FAT16 (LBA)
/dev/sdb2 172032 7761919 3794944 83 Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

So we've now got just two primary partitions /dev/sdb1 (same size as /dev/sdb5 used to be) & /dev/sdb2 (the rest of the available space).

What we've done with those commands is
1. deleted the extended partitions
2. deleted the physical partitions
3. created two new physical partitions
4. written the new partition table back to the SDCard

You'll see where the numbers from step 1 were used to define the new partitions.

Step 4

Copy the data back, check the filesystems and resize.

dd if=raspbmc.sdb5.img of=/dev/sdb1 bs=10M
dd if=raspbmc.sdb6.img of=/dev/sdb2 bs=10M <--- note that partition #6 becomes partition #2

fsck.fat /dev/sdb1
e2fsck -f /dev/sdb2

resize2fs /dev/sdb2

Step 5

Edit the cmdline.txt on /dev/sdb1 we need to change the pointer to partition #6 to now be partition #2.

mkdir /media/sdb1
mount /dev/sdb1 /media/sdb1
nano (or vi) /media/sdb1/cmdline.txt
change root=/dev/mmcblk0p6 to root=/dev/mmcblk0p2
save the updated cmdline.txt
umount /dev/sdb1

You should now be able to boot your RPi from the modified SDCard.
Last edited by DougieLawson on Fri Feb 15, 2019 9:32 pm, edited 3 times in total.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
chrisryall
Posts: 155
Joined: Wed Nov 27, 2013 11:45 am
Location: Wirral UK
Contact: Website

Re: [Tutorial] How to move away from NOOBS

Tue Apr 29, 2014 4:55 pm

Masterly. (And thanks)

I cannot imagine why naive newcomers to Linux find this sort of thing difficult ;)

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: [Tutorial] How to move away from NOOBS

Wed Apr 30, 2014 12:59 pm

Very comprehensive tutorial Dougie :)

You need to highlight 172032 (in the fdisk steps) in blue though and explain where that number comes from (it's 8192 + (81920 * 2) ).

And strictly speaking you ought to modify the /etc/fstab on the new root partition too.

(and just to nitpick, /dev/sdb3 is the NOOBS settings partition, not the root partition ;) NOOBS doesn't have separate boot and root partitions, it's all contained on the one recovery partition.)

User avatar
DougieLawson
Posts: 36159
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: [Tutorial] How to move away from NOOBS

Thu May 01, 2014 1:54 pm

Thanks Andrew - original post has been edited.

I'm testing it on an 8GB NOOBS/Raspbian card today.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

dbijen
Posts: 1
Joined: Fri May 30, 2014 9:35 pm

Re: [Tutorial] How to move away from NOOBS

Fri May 30, 2014 9:52 pm

THANK YOU!!
Your post has saved my life! My 4GB SD-card ran out of space while downloading/extracting the RaspBMC automatic update to v13.1, leaving me with a black screen and 100%CPU of xbmc.bin.

Thanks to your explanation, I was able to partition a new 8GB SD-card and copy the contents of my old (and cripled) 4GB card to it, after which the update

I did run into some problems on your description, however. After creating the partitions, the only way to make them work was to first format them; The FAT-partition I formatted best in Windows, the Ext2-partition I formatted in Linux. After that, I was able to copy the contents of the old SD to the new card.

BartmanEH
Posts: 9
Joined: Sun Jul 12, 2015 4:14 pm

Re: [Tutorial] How to move away from NOOBS

Wed Jul 15, 2015 10:34 pm

The sector size math did not work out for me. Here's what I originally had on my NOOBs SD Card:
Device Boot Start End Sectors Size Id Type
/dev/sdb1 8192 2496093 2487902 1.2G e W95 FAT16 (LBA)
/dev/sdb2 2496512 64778239 62281728 29.7G 85 Linux extended
/dev/sdb3 64780288 64845823 65536 32M 83 Linux
/dev/sdb5 2506752 2629631 122880 60M c W95 FAT32 (LBA)
/dev/sdb6 2637824 64776191 62138368 29.6G 83 Linux

I followed the instructions and computed (122880 x 2) + 8192 = 253952. By the time I created the partitions, the boot partition was twice the original size of 60M and ended up being 120M.

It all seems to work though. Testing continues...

fruitoftheloom
Posts: 20748
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: [Tutorial] How to move away from NOOBS

Wed Jul 15, 2015 10:41 pm

BartmanEH wrote:The sector size math did not work out for me. Here's what I originally had on my NOOBs SD Card:
Device Boot Start End Sectors Size Id Type
/dev/sdb1 8192 2496093 2487902 1.2G e W95 FAT16 (LBA)
/dev/sdb2 2496512 64778239 62281728 29.7G 85 Linux extended
/dev/sdb3 64780288 64845823 65536 32M 83 Linux
/dev/sdb5 2506752 2629631 122880 60M c W95 FAT32 (LBA)
/dev/sdb6 2637824 64776191 62138368 29.6G 83 Linux

I followed the instructions and computed (122880 x 2) + 8192 = 253952. By the time I created the partitions, the boot partition was twice the original size of 60M and ended up being 120M.

It all seems to work though. Testing continues...
The post you are responding to is out-of-date as Noobs installer/chooser has been update considerably over the last 12 months ;)
Retired disgracefully.....

BartmanEH
Posts: 9
Joined: Sun Jul 12, 2015 4:14 pm

Re: [Tutorial] How to move away from NOOBS

Wed Jul 15, 2015 11:13 pm

Out of date or not, this is just about the only instructions in the world that deals with ridding oneself of NOOBS while preserving all the hard work of configuring Raspbian. Furthermore, my NOOBS install predates the original post and NOOBS doesn't get updated except by exceedingly deliberate actions which I haven't taken.

I'd like to understand the math. Here's what I ended up with:
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 8192 253951 122880 e W95 FAT16 (LBA)
/dev/mmcblk0p2 253952 31275007 15510528 83 Linux

User avatar
rpdom
Posts: 15214
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: [Tutorial] How to move away from NOOBS

Thu Jul 16, 2015 7:33 am

BartmanEH wrote:The sector size math did not work out for me. Here's what I originally had on my NOOBs SD Card:
Device Boot Start End Sectors Size Id Type
/dev/sdb1 8192 2496093 2487902 1.2G e W95 FAT16 (LBA)
/dev/sdb2 2496512 64778239 62281728 29.7G 85 Linux extended
/dev/sdb3 64780288 64845823 65536 32M 83 Linux
/dev/sdb5 2506752 2629631 122880 60M c W95 FAT32 (LBA)
/dev/sdb6 2637824 64776191 62138368 29.6G 83 Linux

I followed the instructions and computed (122880 x 2) + 8192 = 253952. By the time I created the partitions, the boot partition was twice the original size of 60M and ended up being 120M.

It all seems to work though. Testing continues...
The important bit here is the headers on the fdisk output. Note that on the original example the headers are

Device Boot Start End Blocks Id System

and in your list they are

Device Boot Start End Sectors Size Id Type

If it shows Sectors you don't need to multiply by 2. One Block = 2 Sectors.

This is because of a different version of fdisk being used.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: [Tutorial] How to move away from NOOBS

Thu Jul 16, 2015 9:14 am

Note that the reason for all this messing around with blocks and sectors is to make sure that the new partitions (the ones you're creating from scratch) are exactly the same size as the originals - so that you can safely/correctly 'dd' the saved images onto the new partitions.

It seems to me that it'd be a lot easier to not endure this complexity, by just creating the partitions to some arbitrary size (I usually just make the boot partition about 100M and leave the rest for the rootfs), and using 'cp' instead of 'dd' to copy from the backups.

Of course, this means that you have to mount the 'dd' file so that you can do a file-level copy, but that shouldn't be too hard to figure out and get going...

IMHO, there are lots of aesthetic/ergonomic reasons to prefer 'cp' over 'dd' for this sort of thing.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
DougieLawson
Posts: 36159
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: [Tutorial] How to move away from NOOBS

Thu Jul 16, 2015 12:50 pm

rpdom wrote: The important bit here is the headers on the fdisk output. Note that on the original example the headers are

Device Boot Start End Blocks Id System

and in your list they are

Device Boot Start End Sectors Size Id Type

If it shows Sectors you don't need to multiply by 2. One Block = 2 Sectors.

This is because of a different version of fdisk being used.
You can use
fdisk -b 1024 -l /dev/sda
to get it to do the maths for you.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
DougieLawson
Posts: 36159
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: [Tutorial] How to move away from NOOBS

Thu Jul 16, 2015 12:53 pm

Joe Schmoe wrote: IMHO, there are lots of aesthetic/ergonomic reasons to prefer 'cp' over 'dd' for this sort of thing.
I don't disagree with you (rsync is possibly even easier than cp). But dd allows me to easily specify the buffer size. On my RPi2B I can use bs=500M so I don't have to wait all night for the copy to run.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

BartmanEH
Posts: 9
Joined: Sun Jul 12, 2015 4:14 pm

Re: [Tutorial] How to move away from NOOBS

Thu Jul 16, 2015 1:23 pm

Great information, all. This is now the ultimate thread on the issue of moving away from NOOBs. Thanks.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: [Tutorial] How to move away from NOOBS

Thu Jul 16, 2015 1:30 pm

Dougie, I get that - but it has never been an issue for me.

I haven't tested extensively but my observations have been that the overall speed with "cp -a" is about the same as with (optimized) 'dd'. In fact, I've had at least some experiences where using 'dd' is really bad slow.

In particular, copying the Raspbian rootfs (from network mounted image) to SD card takes about 35 minutes.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

wackojacko1997
Posts: 1
Joined: Sun Jul 17, 2016 1:20 am

Re: [Tutorial] How to move away from NOOBS

Mon Jul 18, 2016 2:55 am

First post, and I have to use British English on this site.... no allowance to speak 'American' in the setup, even 240 years after we Brexited ourselves.... Blimey!!! (or however the Brits spell that)

I have spent a perfectly wonderful summer weekend working with the contents of this post with very little to show for it. I am using a RPi2 and trying to clone the relevant portions of the NOOBs card (with Raspbian installed and running on the machine -- "mmcblk0" below) onto a 2nd, separate MicroSD card ("sda" below). I previously (yesterday) was able to copy mmcblk0p5 and mmcblk0p6 onto a thumbdrive ("sdb" in the below) as .img files using 'dd' as described at the beginning of this thread. I seem to have trouble once I've completed partitioning "sda" when I used fsck.fat and e2fsck. I learned how to use 'script' to log my latest attempt in hopes that someone can guide me where I need to go, but I note that I've got some encoding problem when you look at the logfile, so I've added ##[comments]## below to show you what was actually typed, in case what you see in reality in the log has some meaning to someone. Oh, and yes, I used ssh from my Mac to get into the RPi2 because I didn't want to figure out how to get this done on the RPi2 proper.

Why am I doing this? I bought two more RPi2 for my niece and nephews (ages 9 to 12) who are visiting in two weeks, and I want to give them already set up RPi2s (as mine is already configured), plus I want to give them as simple instructions as possible to clone and backup their microSD cards so that they can experiment freely without needing their uncle 8 hours away to troubleshoot. This uncle is new to Linux and their parents are technologically worthless. Suggestions/help appreciated.


****BEGIN LOG FILE OUTPUT****

Script started on Sun Jul 17 21:00:17 2016
[?1034hbash-3.2$ ssh [email protected]
[email protected]'s password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Jul 17 19:57:20 2016 from 192.168.2.102

]0;[email protected]: ~[01;[email protected][00m [01;34m~ $[00m suid[K[Kdu[Ko -i
[email protected]:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 14.5G 0 disk
├─sda1 8:1 1 60M 0 part /media/pi/boot ##[ I noticed later that sda1 & sda2 were mounted, and I unmounted them ]##
└─sda2 8:2 1 14.4G 0 part /media/pi/root[/code] ##[ but for brevity I cut that out of this posting ]##
sdb 8:16 1 14.9G 0 disk
└─sdb1 8:17 1 14.9G 0 part /media/pi
mmcblk0 179:0 0 7.3G 0 disk
├─mmcblk0p1 179:1 0 1G 0 part
├─mmcblk0p2 179:2 0 1K 0 part
├─mmcblk0p3 179:3 0 32M 0 part /media/root/SETTINGS
├─mmcblk0p5 179:5 0 60M 0 part /boot
└─mmcblk0p6 179:6 0 6.2G 0 part /
[email protected]:~# fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 7.3 GiB, 7860125696 bytes, 15351808 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
Disklabel type: dos
Disk identifier: 0x000eb74b

[1mDevice Boot Start End Sectors Size Id Type[0m
/dev/mmcblk0p1 8192 2121093 2112902 1G e W95 FAT16 (LBA)
/dev/mmcblk0p2 2121728 15286271 13164544 6.3G 85 Linux extended
/dev/mmcblk0p3 15286272 15351807 65536 32M 83 Linux
/dev/mmcblk0p5 2129920 2252799 122880 60M c W95 FAT32 (LBA)
/dev/mmcblk0p6 2260992 15286271 13025280 6.2G 83 Linux

Partition table entries are not in disk order.
[email protected]:~# fdisk -b 1024 l[K-l /dev/mmcblk0 ##[ Actual command was: "fdisk -b 1024 -l /dev/mmcblk0" ]##

Disk /dev/mmcblk0: 14.7 GiB, 15720251392 bytes, 15351808 sectors
Units: sectors of 1 * 1024 = 1024 bytes
Sector size (logical/physical): 1024 bytes / 1024 bytes
I/O size (minimum/optimal): 1024 bytes / 1024 bytes
Disklabel type: dos
Disk identifier: 0xffffffff

[1mDevice Boot Start End Sectors Size Id Type[0m
/dev/mmcblk0p1 ? 6823936 8396799 1572864 1.5G e W95 FAT16 (LBA)
/dev/mmcblk0p2 65648 131183 65536 64M 70 DiskSecure Multi-Boot
/dev/mmcblk0p3 895811584 5008094719 4112283136 3.8T 0 Empty
/dev/mmcblk0p4 ? 842072064 1633824567 791752504 755.1G 0 Empty
/dev/mmcblk0p5 2129920 2252799 122880 120M c W95 FAT32 (LBA)
/dev/mmcblk0p6 2260992 15286271 13025280 12.4G 83 Linux

Partition table entries are not in disk order.
[email protected]:~# fdisk -l /dev/sda

Disk /dev/sda: 14.5 GiB, 15523119104 bytes, 30318592 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
Disklabel type: dos
Disk identifier: 0x000eb74b

[1mDevice Boot Start End Sectors Size Id Type[0m
/dev/sda1 8192 131071 122880 60M e W95 FAT16 (LBA)
/dev/sda2 131072 30318591 30187520 14.4G 83 Linux

[email protected]:~# difks[K[K[K[K[Kfisk[K[K[Kdisk /dev/sda
[32m ##[ Not sure why it reads as seen above, but actual command was: "fdisk /dev/sda" ]##
Welcome to fdisk (util-linux 2.25.2).
[0mChanges will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): d
Partition number (1,2, default 2): 2

Partition 2 has been deleted.

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-30318591, default 2048): 8192
Last sector, +sectors or +size{K,M,G,T,P} (8192-30318591, default 30318591): +122880

Created a new partition 1 of type 'Linux' and of size 60 MiB.

Command (m for help): n
Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (2048-30318591, default 2048): 131072
Last sector, +sectors or +size{K,M,G,T,P} (131072-30318591, default 30318591):

Created a new partition 2 of type 'Linux' and of size 14.4 GiB.

Command (m for help): t
Partition number (1,2, default 2): 1
Hex code (type L to list all codes): e

If you have created or modified any DOS 6.x partitions, please see the fdisk documentation for additional information.
Changed type of partition 'Linux' to 'W95 FAT16 (LBA)'.

Command (m for help): p
Disk /dev/sda: 14.5 GiB, 15523119104 bytes, 30318592 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
Disklabel type: dos
Disk identifier: 0x000eb74b

[1mDevice Boot Start End Sectors Size Id Type[0m
/dev/sda1 8192 131071 122880 60M e W95 FAT16 (LBA)
/dev/sda2 131072 30318591 30187520 14.4G 83 Linux


Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

[email protected]:~# lsp[Kblk ##[ Actual command was: "lsblk" ]##
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 14.5G 0 disk
├─sda1 8:1 1 60M 0 part
└─sda2 8:2 1 14.4G 0 part
sdb 8:16 1 14.9G 0 disk
└─sdb1 8:17 1 14.9G 0 part /media/pi
mmcblk0 179:0 0 7.3G 0 disk
├─mmcblk0p1 179:1 0 1G 0 part
├─mmcblk0p2 179:2 0 1K 0 part
├─mmcblk0p3 179:3 0 32M 0 part /media/root/SETTINGS
├─mmcblk0p5 179:5 0 60M 0 part /boot
└─mmcblk0p6 179:6 0 6.2G 0 part /
[email protected]:~# ls /media/pi/
Bash Exercises and Solutions config.txt rasbp2.mmcblk0p6.img Super Kit V2.0 for Arduino
config_backup.txt rasbp2.mmcblk0p5.img SanDiskSecureAccessV2_win.exe System Volume Information
[email protected]:~# dd if=/medial[K.[K/pi/Ra[K[Krasbp2.mmcblk0pp[K5.img of=/s[Kdev/sda1 bs=1-[K0M
##[ Actual command for the above line was: "dd if=/media/pi/rasbp2.mmcblk0p5.img of=/dev/sda1 bs=10M" ]##
6+0 records in
6+0 records out
62914560 bytes (63 MB) copied, 11.3505 s, 5.5 MB/s
[email protected]:~# dd if=/media/pi/rasbp2.mmcblk0p5.img of=/dev/sda1 bs=10M[C[1P bs=10M2 bs=10M[C[1P[[email protected]
##[ Actual command for the above line was: "dd if=/media/pi/rasbp2.mmcblk0p6.img of=/dev/sda2 bs=10M" ]##
409+1 records in
409+1 records out
4294967295 bytes (4.3 GB) copied, 479.118 s, 9.0 MB/s
[email protected]:~# fsk[Kck.fat /s[Kdev/sda1 ##[ Actual command: "fsck.fat /dev/sda1" ]##
fsck.fat 3.0.27 (2014-11-12)
0x25: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt. ##[ IS THIS MY PROBLEM???????? ]##
1) Remove dirty bit
2) No action
? 1
Leaving filesystem unchanged.
/dev/sda1: 105 files, 10232/30651 clusters
[email protected]:~# fsck.fat /dev/sda1[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[Ked[K2fsck -f /dev/sda2
##[ Actual command here was: "e2fsck -f /dev/sda2" ]##
e2fsck 1.42.12 (29-Aug-2014)
root: recovering journal
Pass 1: Checking inodes, blocks, and sizes
Inode 260628 has a extra size (15100) which is invalid
Fix<y>? yes
Inode 260628 has compression flag set on filesystem without compression support. Clear<y>? yes
Inode 260628 has a bad extended attribute block 6. Clear<y>? yes
Inode 260628 has INDEX_FL flag set but is not a directory.
Clear HTree index<y>? yes
Inode 260628, i_size is 72791629719222154, should be 0. Fix<y>? yes
Inode 260628, i_blocks is 351762, should be 0. Fix<y>? yes
Inode 260630 is in use, but has dtime set. Fix<y>? yes
Inode 260630 has a extra size (40095) which is invalid
Fix<y>? yes
Inode 260631 is in use, but has dtime set. Fix<y>? yes
Inode 260631 has imagic flag set. Clear<y>? yes
Inode 260631 has a extra size (13196) which is invalid
Fix<y>? yes
Inode 260632 is in use, but has dtime set. Fix<y>? yes
Inode 260632 has a extra size (14259) which is invalid
Fix<y>? yes

*******************CUTTING OUT THE CRAZINESS******************************
BECAUSE I LET THIS GO WAY TOO LONG BEFORE I Ctrl-C to quit
*******************BUT YOU SEE BASICALLY WHAT I DID***********************

Inode 260966, i_size is 1511858553198676, should be 0. Fix<y>? yes
Inode 260966, i_blocks is 352003, should be 0. Fix<y>? yes
Inode 260967 has a extra size (27493) which is invalid
Fix<y>? yes
Inode 260969 is in use, but has dtime set. Fix<y>? no
Inode 260969 has imagic flag set. Clear<y>?
root: e2fsck canceled.

root: ***** FILE SYSTEM WAS MODIFIED *****

root: ********** WARNING: Filesystem still has errors **********

[email protected]:~# exit
logout
]0;[email protected]: ~[01;[email protected][00m [01;34m~ $[00m exit
logout
Connection to 192.168.2.105 closed.

bash-3.2$ exit
exit

Script done on Sun Jul 17 21:28:26 2016

**** END LOG FILE OUTPUT *****

User avatar
DougieLawson
Posts: 36159
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: [Tutorial] How to move away from NOOBS

Mon Jul 18, 2016 7:19 pm

Warning: You're using a tutorial I wrote more than two years ago. It has NOT been tested with a NOOBS/Jessie system. It hasn't been tested since April 2014.

sudo fsck -f -y /dev/sda1 (usually works for FAT partitions). Or stick the SDCard in a Windows system and let Windows check disk repair it.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

ecc29
Posts: 1
Joined: Sun Apr 26, 2015 9:31 pm

Re: [Tutorial] How to move away from NOOBS

Thu Oct 06, 2016 1:29 am

Just want to confirm that DougieLawson's method still works with NOOBS/Jessie. The only difference is modifying /etc/fstab seems to be optional for old version (mmcblk0p6 -> mmcblk0p1 & mmcblk0p7 -> mmcblk0p2), but with Jessie it's a must.

someone24
Posts: 1
Joined: Tue Dec 27, 2016 11:11 pm

Re: [Tutorial] How to move away from NOOBS

Tue Dec 27, 2016 11:28 pm

chrisryall wrote:Masterly. (And thanks)

I cannot imagine why naive newcomers to Linux find this sort of thing difficult ;)
Nothing to do with being Naive, Obviously there is an elitism cancer within Linux communities. I love Linux but I hate the strangulation of newcomers. Have you looked at the manpage that makes no sense? yes I have! They often struggle to make any sense.

fabit
Posts: 1
Joined: Sun Feb 18, 2018 2:09 pm

Re: [Tutorial] How to move away from NOOBS

Sun Feb 18, 2018 2:52 pm

Worked fine also migrating from NOOBS/ Stretch.

Thanks very much for this very useful tutorial. I appreciated it for creating a backup, using Raspy with123Solar Datalogger, firstly installed with NOOBS.

Using fdisk, option 'n', creating the new 2nd partition in the new SDcard, /dev/sdc2, calculated the 'Start block' and 'End block', perhaps in a slightly different manner:

First sector : (Last sector_of_newsd_sdc1_partition)+1
Offset for the Last sector: + (N_sectors_of_ mmcblk0p7)-1
I dont know if more or less correct, It seem working good until now...

DanR
Posts: 33
Joined: Fri Jan 18, 2013 1:20 pm

Re: [Tutorial] How to move away from NOOBS

Fri Feb 15, 2019 12:00 pm

I have tried everything I can find on moving the boot and root partitions to a new sd card without noobs and nothing has worked. I tried this tutorial, cp -a, rsync etc and the most I get is boot to pixel splash screen and then a message:

"You are in emergency mode. After logging in, type "journalctl -xb" etc etc Press Enter to continue.

After pressing enter I get "Plymouth-start.service" at the bottom and then the same message again, rinse and repeat forever.

Any pointers please?? I'm desperate at this point...

TIA Dan

UPDATE: It does work, I needed to update the /etc/fstab entries too!!
I now have what seems like 2 boot folders though, one in the Linux partition which although appears normal is actually a copy of the one that should be in the 1st partition and not a sym link. No idea why, but I need to fix that too, so any ideas anyone???

User avatar
procount
Posts: 1739
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: [Tutorial] How to move away from NOOBS

Fri Feb 15, 2019 1:15 pm

The /boot folder is a mount point for the boot partition (mounted through /etc/fstab). It is not a symlink.

How do you know the contents are a duplicate of the boot partition and not the same files? Did you view it when the SD card was booted in a RPi,or did you view it when the SD card was mounted in a USB reader on another computer?

What is the output of `mount` when the card is booted in a RPi?
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

User avatar
DougieLawson
Posts: 36159
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: [Tutorial] How to move away from NOOBS

Fri Feb 15, 2019 7:28 pm

Can I just remind folks that this stuff is FIVE YEARS OLD and quite possibly out-of-date. It has not been tested by me since 1st May 2014.

When it breaks your NOOBS card and leaves you with an unbootable mess of junk don't blame me.

I'm also not prepared to test it at the moment with NOOBS 3.0.0.

USE WITH EXTREME CAUTION.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
scruss
Posts: 2486
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: [Tutorial] How to move away from NOOBS

Fri Feb 15, 2019 9:17 pm

You could edit your post and put that at the top ...
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

SvbZ3r0
Posts: 1
Joined: Wed Jun 12, 2019 6:03 am

Re: [Tutorial] How to move away from NOOBS

Wed Jun 12, 2019 6:07 am

Thanks for the great tutorial @DougieLawson. I created this account just to confirm that this method still works with NOOBS 3+ (latest version as on date) and Raspbian Stretch.

Return to “Advanced users”