hanna
Posts: 19
Joined: Sat Dec 22, 2012 4:25 pm

using someone else's image

Sat Nov 30, 2013 3:59 pm

hey all - after putting my crashed Pi on the shelf for most of the year, i've decided to resurrect it using a friend's image. using Windiskimager, i made a copy of his 32g sd card in order to copy it onto mine. however, my new 32 g sd card is actually has only 30 gigs of space, so i am unable to copy the image (also using Windiskimager) because the new card does not have enough space.

i no longer have access to the original image - is there anything i can do to compress or compact the image file to make it fit onto the new card? or am i stuck buying a 64g card in order to fit a 32g image on it (which seems terribly inefficient)?

thanks!

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: using someone else's image

Sat Nov 30, 2013 4:15 pm

It can be done, not that difficult, but why do you need to use your friends image ? It would be easier to use a freshly downloaded one...
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

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

Re: using someone else's image

Sun Dec 01, 2013 3:45 am

hanna wrote: however, my new 32 g sd card is actually has only 30 gigs of space, so i am unable to copy the image (also using Windiskimager) because the new card does not have enough space.
That's because of two reasons.
1. There's a lot of confusion between GiB and GB (one uses base 10 maths the other uses base 2 maths)
http://en.wikipedia.org/wiki/Gigabit
http://en.wikipedia.org/wiki/Gigabyte
http://en.wikipedia.org/wiki/Gibibyte

2. Your 32GB card has more than one partition on it.


My 32G card looks like this:

Code: Select all

pi@pi ~ $ sudo fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 31.5 GB, 31499223040 bytes
4 heads, 16 sectors/track, 961280 cylinders, total 61521920 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: 0x000714e9

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            8192      122879       57344    c  W95 FAT32 (LBA)
/dev/mmcblk0p2          122880    61521919    30699520   83  Linux
/dev/mmcblk0p3            2048        8191        3072   82  Linux swap / Solaris

Partition table entries are not in disk order
pi@pi ~ $
31499223040 / 1024 == 30,760,960 KB
30760960 / 1024 == 30,040 MB
30040 / 1024 == 29.3359375 GB

But it's 31.5GiB (rounded up from 31.4992).

Admittedly it's short of the full 32GB what ever way I work it from the fdisk -l output. But they are mostly going to all come in that short. Never believe what a disk (or solid state) storage salesman tells you. He'll be interchanging GiB and GB, in his favour, when it suits him.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

hanna
Posts: 19
Joined: Sat Dec 22, 2012 4:25 pm

Re: using someone else's image

Sun Dec 01, 2013 1:59 pm

pluggy wrote:It can be done, not that difficult, but why do you need to use your friends image ? It would be easier to use a freshly downloaded one...
easier for you, maybe :D

i figured it was the shortest route to getting my Pi up and running again - my friend's image is customized with some things i would like and since i'm a complete noob, made sense to use his. so, how would you do it?

Dutch_Master
Posts: 362
Joined: Sat Jul 27, 2013 11:36 am

Re: using someone else's image

Sun Dec 01, 2013 2:15 pm

It can be done, but as a self-confessed 'complete noob' it's probably beyond your skills. Or so you think ;) It involves mounting the image (assuming you have it somewhere) in a loopback device, shrinking the partition by about 1 GB and copying it over using the dd command. But it does require a working Linux environment and I have the feeling you don't have that ;)

mardimus
Posts: 7
Joined: Sat Nov 30, 2013 8:59 pm

Re: using someone else's image

Sun Dec 01, 2013 5:26 pm

I have been in this situation with SD cards and HDD. Its honestly easier to purchase a larger SD card for your situation. With all the deals going on this weekend, you should be fine. I bought two 64GB cards for $50, $25 each. Saves you the headache.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: using someone else's image

Sun Dec 01, 2013 8:35 pm

hanna wrote:
pluggy wrote:It can be done, not that difficult, but why do you need to use your friends image ? It would be easier to use a freshly downloaded one...
easier for you, maybe :D

i figured it was the shortest route to getting my Pi up and running again - my friend's image is customized with some things i would like and since i'm a complete noob, made sense to use his. so, how would you do it?
Its been answered dozens of times on here in the past, indeed there are probably a dozen ways of doing it, heres one that doesn't involve me posting anything :

http://www.raspberrypi.org/phpBB3/viewt ... 91&t=62233
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

hanna
Posts: 19
Joined: Sat Dec 22, 2012 4:25 pm

Re: using someone else's image

Mon Dec 02, 2013 1:31 am

pluggy wrote:
hanna wrote:
pluggy wrote:It can be done, not that difficult, but why do you need to use your friends image ? It would be easier to use a freshly downloaded one...
easier for you, maybe :D

i figured it was the shortest route to getting my Pi up and running again - my friend's image is customized with some things i would like and since i'm a complete noob, made sense to use his. so, how would you do it?
Its been answered dozens of times on here in the past, indeed there are probably a dozen ways of doing it, heres one that doesn't involve me posting anything :

http://www.raspberrypi.org/phpBB3/viewt ... 91&t=62233
thanks - that link was helpful. no, i don't have a working Linux box atm, so i tried USBit, as referenced in the link you posted, using the "truncate oversized image" option, and was able to get the image onto my 32Gb card. hopefully, it didn't truncate anything critical and i'll be able to fire it up shortly. just as soon as i get done with my hot oil massage.

thanks!

Return to “Beginners”