timmoore46
Posts: 266
Joined: Tue Jul 17, 2012 4:36 pm

Cloning a 16GB Class 10 SD card

Mon Jan 28, 2013 11:37 am

I've been developing some bash scripts plus a lot else, and don't want to lose the OS which now has lots of extras.

The OS's available is Mint 14 Linux also Windows Pro as well as the June 2013 (or a month or two earlier) version of Raspberry.

I'm very nervous as its easy to clone a blank SD card on top of the only master, in error ! *LOL* :evil:

I've got a working CD of 'Clone Zilla' also G4L.

Any thoughts from anyone most welcome !

:D :D :D

Tim

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: Cloning a 16GB Class 10 SD card

Mon Jan 28, 2013 11:48 am

Does the master have a write protect switch? Just set it which will ensure it's not erased. Otherwise clonezilla will do the job or use DD, but just be careful with your commands. Also before cloning if you're worrying about losing important stuff just ftp or copy that stuff over to another machine, at least if you kill your master by mistake you'll still have the stuff you worked on.

User avatar
Jim JKla
Posts: 2218
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK

Re: Cloning a 16GB Class 10 SD card

Mon Jan 28, 2013 12:21 pm

You could use Win32DiskImage to make a Backup of the SD card but be careful of that.

The lock switch on the side of the SD does not work in the RPi but it would protect your Card while you were making a backup with Win32DiskImage in a PC. ;)
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick

pjc123
Posts: 913
Joined: Thu Mar 29, 2012 3:37 pm
Contact: Website

Re: Cloning a 16GB Class 10 SD card

Mon Jan 28, 2013 12:37 pm

I have to agree with copying your important changed files over to another computer or external hard disk before you clone it just to be safe. In fact I back up files I have written or changed on a regular basis, and do full images less frequently as part of my backup plan. Now I use Clonezilla a lot, but there are so many steps involved in doing a backup/restore, that the chances of picking the wrong drive(s) or backing up / restoring in the wrong direction are pretty high.

With a program like Win32DiskImager you can read or write images with just a couple of steps, minimizing the chances of error; the only disadvantage is that you are backing up the entire card, not just the used sectors like Clonezilla, so the image files can be pretty large. Another advantage of Win32DiskImager is that if you mistakenly try to write an image from your hard disk over an existing critical card image, the program is going to have to find an image on your hard disk first, and if that starts to happen you know you did the process in reverse, and can abort the program. Can you still make a mistake.....well garbage in, garbage out.
My Raspberry Pi Project Page:
https://www.flaminghellmet.com/launch/

User avatar
Jim JKla
Posts: 2218
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK

Re: Cloning a 16GB Class 10 SD card

Mon Jan 28, 2013 1:58 pm

Remember the whole system is still in development there will come a time when we will be able to cherry pick files for backup but until that time whole SD backups are probably the norm. ;)
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick

timmoore46
Posts: 266
Joined: Tue Jul 17, 2012 4:36 pm

Re: Cloning a 16GB Class 10 SD card

Tue Jan 29, 2013 6:12 am

Win32diskimage sounds the best bet for me.

Many many thanks everyone for all the tips ! Very greatly appreciated!

I will report back my results.

:D :D :D :D :D :D

Tim

thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: Cloning a 16GB Class 10 SD card

Tue Jan 29, 2013 6:46 am

Here you can find step-by-step instructions:
http://www.raspberrypi.org/phpBB3/viewt ... 26&t=26463

timmoore46
Posts: 266
Joined: Tue Jul 17, 2012 4:36 pm

Re: Cloning a 16GB Class 10 SD card

Tue Jan 29, 2013 5:37 pm

Brilliant Guide, thank you.

After 6 1/2 hours the 16GB SD was imaged ok !

So I poped and blank in and attempted to write the img to it.......

Message came back:-

Needed 32,433,360 sectors

Available 31,537,152 sectors

Hmmmm....

ordering a 32 GB SD card...

Anybody any ideas ?

A puzzled,

:cry: :cry: :cry: :cry:

Tim

User avatar
Jim JKla
Posts: 2218
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK

Re: Cloning a 16GB Class 10 SD card

Tue Jan 29, 2013 6:49 pm

Not all SD cards are equal.

To paraphrase Orwell (Animal Farm)

All SD cards are equal but some are more equal than others. :lol:

You need to match Brand Size & Class and even then one or both could be fakes. ;) If I have issues with an SD imageing I format it in my camera first. ;)
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick

Dilligaf
Posts: 283
Joined: Wed May 23, 2012 6:48 pm

Re: Cloning a 16GB Class 10 SD card

Tue Jan 29, 2013 7:27 pm

Use USBIT http://www.alexpage.de/usb-image-tool/download/ it will make and backup .img.gz compressed images, just turn off check for >4gb in options. They will be a lot smaller. If you want the image to fit any 16G card shrink the last partition slightly with gparted on Linux box/live usb then when writing back to a smaller card tell usbit to write truncated image to smaller cards, as long as you shrunk it enough all partitions will be written and the blank space at the end will get truncated

pjc123
Posts: 913
Joined: Thu Mar 29, 2012 3:37 pm
Contact: Website

Re: Cloning a 16GB Class 10 SD card

Tue Jan 29, 2013 10:29 pm

timmoore46 wrote:After 6 1/2 hours the 16GB SD was imaged ok !
Tim
6 1/2 hours! WOW. I don't know what model card reader and SD card, computer hardware, Windows operating system version, etc. that you have, but that is a ridiculous amount of time. My Win32DiskImager image backups run at an average 17 MB/s (according to the program) and take typically 15 minutes to back up my 16GB SD card to an image on an external USB hard drive. I have also verified that the backups are valid by doing a restore to a second SD card.

Needed 32,433,360 sectors

Available 31,537,152 sectors

Are you using the exact same brand, model and size card for the image backup and image restore?
My Raspberry Pi Project Page:
https://www.flaminghellmet.com/launch/

timmoore46
Posts: 266
Joined: Tue Jul 17, 2012 4:36 pm

Re: Cloning a 16GB Class 10 SD card

Wed Jan 30, 2013 5:11 am

I used an aged Laptop running Vista. By unfortunate chance. My main PC is a 6 core 8GB ram and about a year old which may be a tad faster.

Broadband went down and repairman cometh Feb 7th Grrrr.... so sorting out a Dongle on Linux (non trivial) and used anything that had a second dongle for the task of getting the image captured.

I think they were the same brand but as I put it back in the RPi, I've not checked yet.

Many thanks all for the helpful comments...

Does GParted run of the RPi OK ?

:D :D :D :D

Tim

timmoore46
Posts: 266
Joined: Tue Jul 17, 2012 4:36 pm

Re: Cloning a 16GB Class 10 SD card

Wed Jan 30, 2013 6:11 am

I used identical SD cards :-

Elite Pro 16GB class 10.

So which SD card manufacturers do work with the Win32DiscImager software, without this joke ?

:? :? :?

Tim

Dilligaf
Posts: 283
Joined: Wed May 23, 2012 6:48 pm

Re: Cloning a 16GB Class 10 SD card

Wed Jan 30, 2013 6:21 am

timmoore46 wrote:I used identical SD cards :-

Elite Pro 16GB class 10.

So which SD card manufacturers do work with the Win32DiscImager software, without this joke ?

:? :? :?

Tim
As far as size variance none really, as sectors are marked bad their size will change, just because there are some bad sectors when they are manufactured doesn't mean the card wont be sold, I think they have a minimum size spec. That 4 gig card you just bought may really be an 8gig that didn't meet standards. The same cards off the same line could potentially all have different sizes

timmoore46
Posts: 266
Joined: Tue Jul 17, 2012 4:36 pm

Re: Cloning a 16GB Class 10 SD card

Wed Jan 30, 2013 7:11 am

Tried a different one from the same shipment.

Tried to re-create the img file and got Error 2 on my Win 7 Pro box.

Tried to move the img file from the Vista laptop onto a WD 320GB portable drive (3 years old +) and it moaned with 'file too big'. Anyone got one of these 'no power supply' type portable drives that can cope with 16GB drives ?

So waiting on 32GB Sd card to arrive.

:? :? :?

Tim

thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: Cloning a 16GB Class 10 SD card

Wed Jan 30, 2013 8:55 am

After 6 1/2 hours the 16GB SD was imaged ok !
So I poped and blank in and attempted to write the img to it.......
Message came back:-
Needed 32,433,360 sectors / Available 31,537,152 sectors / Hmmmm....
Win32DiskImager always copy the full SD card, but this is not necessary.
You could try to use dd (there are versions for windows, e.g. http://www.chrysocome.net/dd)
instead of win32disk to copy only an less maller part of the original SD card.
In your case the difference betwenn the sizes is unusually large, nearly 1 GB!
Assuming the 2nd partition on the SD card is not used to its end, then copying a little lower amount would not
harm the content.
"dd" should be started as administrator (Windows: Start, cmd.exe, right mouse, "run as admin..",

Code: Select all

dd --list
will show the "NT Block Device Objects", there you can find your card drive.
On my computer i identified it as '\\?\Device\Harddisk1\SR0'.
I used this in a small batch file like to copy the SD card

Code: Select all

dd.exe if=\\?\Device\Harddisk1\SR0 of=<YourFileName>.img bs=1M count=<SizeInMB> --size --progress
--> 
dd.exe if=\\?\Device\Harddisk1\SR0 of=img8g_02_yymmdd.img bs=1M count=7500 --size --progress
(for a 8 GB card, )
'count= ...' should be roughly the size of your smaller card.
Later, you can re-use Win32DiskImager.

thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: Cloning a 16GB Class 10 SD card

Wed Jan 30, 2013 9:03 am

timmoore46 wrote: Tried to move the img file from the Vista laptop onto a WD 320GB portable drive (3 years old +) and it moaned with 'file too big'. Anyone got one of these 'no power supply' type portable drives that can cope with 16GB drives ?
Tim
Presumably, your external hard drive is formatted with FAT, this is limiting the max. filesize to about 4 GB.
Using command 'convert' (in the 'DOS' box, see http://technet.microsoft.com/en-us/libr ... 56984.aspx) allows you to change the formatting to NTFS.

timmoore46
Posts: 266
Joined: Tue Jul 17, 2012 4:36 pm

Re: Cloning a 16GB Class 10 SD card

Wed Jan 30, 2013 5:59 pm

Hi thsBavR10

Many many thanks !

As I'm terrified of nuking my Mrs's Laptop with a DD command, I'll wait until I get my own gash PC to try the CLI on a Windows box ! Looks very neat solution though.

The FAT portable hard drive services a neat Video recorder as an external drive and I'm not sure if it can read NTFS. It was a pig to get it work with the recorder, which it does nicely.

I'll try these ideas out if the 32 GB SdD card does not work.

Does Gparted work on the Rpi ?

:D :D :D :D :D

Tim

timmoore46
Posts: 266
Joined: Tue Jul 17, 2012 4:36 pm

Re: Cloning a 16GB Class 10 SD card

Thu Jan 31, 2013 5:23 pm

Both my Win 7 Pro box and the Vista laptop can use Win32 Imager fine to make a 16GB Sd card from the original downloaded master of Raspbian.

With the 32GB SD card it lays in the 56Mb partition ok, then rejects the SD card from being recognised by the PC and offers error 2 !

Not sure what to do now, buy yet another make of 32GB Class 10 card ? drop to class 4. or go for a 16GB or sulk for a month and try again ? *LOL*

:? :? :?

Tim

timmoore46
Posts: 266
Joined: Tue Jul 17, 2012 4:36 pm

Re: Cloning a 16GB Class 10 SD card

Fri Feb 01, 2013 8:39 am

I decided to try this:-

16GB KINGSTON SD SDHC MEMORY CARD CLASS 4 FOR DIGITAL CAMERA

Will take a week to arrive. (?)

Lets see if it works !

:D

Tim

timmoore46
Posts: 266
Joined: Tue Jul 17, 2012 4:36 pm

Re: Cloning a 16GB Class 10 SD card

Sat Feb 02, 2013 5:56 am

Maybe the total answer lives here:-

Quote from the article:-

"Equally, whether on Linux or Windows, if you
are using the 32-bit version then once again a
file size limitation will be encountered. The
maximum size for a single file on a 32-bit
operating system is 4Gb. If your backup file is
larger than this you will have to split it into 4Gb
chunks. Compressing and splitting backups is
covered in detail below."

end Quote

so 16GB files can never work with Win32DiskImager.

all here:-

In the download link (I hope) to TheMagPi magazine pages 12-14 of part one "Back up your Raspberry Pi"

Issue 9 - February 2012

Not sure if this link will work.

https://mail.google.com/mail/u/0/?hl=en ... 72711a5d05

Also offers DVD recording of the SD card split into sections.

Just have to wait a month for part 2 ! *LOL*

:D :D :D

Tim

thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: Cloning a 16GB Class 10 SD card

Sat Feb 02, 2013 3:40 pm

NTFS (standard file system for windows XP/Vista/7..) supports much bigger files,
see http://en.wikipedia.org/wiki/Ntfs.
"Maximum file size: As designed, the maximum NTFS file size is 16 EB (16 × 10246 or 264 bytes) minus 1 kB or 18,446,744,073,709,550,592 bytes. As implemented, the maximum NTFS file size is 16 TB minus 64 kB or 17,592,185,978,880 bytes. With Windows 8, the maximum NTFS file size is 256 TB minus 64 KB or 281,474,976,645,120 bytes. [4] "

External drives often are formatted with FAT / FAT32, (http://en.wikipedia.org/wiki/Fat32#FAT32),
"The maximum possible size for a file on an FAT32 volume is 4 GB minus 1 byte or 4,294,967,295 (232−1) bytes. This limit is a consequence of the file length entry in the directory table and would also affect huge FAT32 partitions with a sufficient sector size.[1] "
But you may change the file system :-)

timmoore46
Posts: 266
Joined: Tue Jul 17, 2012 4:36 pm

Re: Cloning a 16GB Class 10 SD card

Sun Feb 03, 2013 6:59 am

I'm confused (normal state *LOL*) as the 64bit Vista laptop will be NTFS and the Win32DiscImager software writes a 56Mb partition ? then presumably an ext3 section courtesy of bit copying, why does it give up so comprehensively when writing a 16GB image file to a 32GB Sd card ?

Probably a duff 32GB SD card ?

:? :? :?

Tim

thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: Cloning a 16GB Class 10 SD card

Sun Feb 03, 2013 11:48 am

Win32Diskimager is writing 2 partitions, (the full SD card),
but windows can only "see" the small first partition (about 56MB), because this is a partition of type FAT.
The second partition on the SD card (the rest to the full 16 GB) is not visible to Windows,
because the file system is not known (only for windows, it's just a bit silly)-
but is does work for linux and the raspberry, just try it!

User avatar
Jim JKla
Posts: 2218
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK

Re: Cloning a 16GB Class 10 SD card

Sun Feb 03, 2013 12:06 pm

This is a bit of a red herring Windows does see the partition just does not know what to do with it.

Win32DiskImage is a windows program that can read or write a full SD card so it must be able to read or write the Linux partition the fact that it doeas not recognise it as a partition is neither here nor there. ;)
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick

Return to “General discussion”