Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I used dd to write a 2GB image to an 8GB SD card; gparted now sees it as a 2GB SD card and I can't figure out how to format it for 8GB again. ddalso sees it as a 2GB SD card when trying to format it with of=/dev/sdb if=/dev/zero bs=1M. How can I get it to know its real size?

share|improve this question
1  
By copying 2GB image to flash you have overwrite its partition table. To fix it you can use fdisk: simply create new partition in free space. If you want to copy data from 2GB image to 8GB flash, then mount image through loop device and simply copy its content by cp or file manager (but then you will lose a boot record, to fix it first copy first 512 bytes of image to flash by dd). –  Eddy_Em Mar 22 '13 at 5:36
    
BTW, to clear your flash you need to say dd if=/dev/zero of=/dev/sdX bs=10M, not of=/dev/zero. This will take a long time, so much simpler way is to use fdisk: remove all partitions, then create some or just format flash without creating partitions if you don't need more than one partition. –  Eddy_Em Mar 22 '13 at 5:39
    
I corrected my question to fix the typo that your second comment addresses. I had used if=/dev/zero,just typed it wrong. –  Jakob Weisblat Mar 22 '13 at 5:52
    
What does fdisk -l /dev/sdb shows? –  Eddy_Em Mar 22 '13 at 6:47

1 Answer 1

up vote 1 down vote accepted

you can use the following commands:

cat /proc/partitions
cfdisk YOUR_DEVICE ===> such as cfdisk /dev/sdb
share|improve this answer
    
This helps, but the cfdisk utility doesn't seem to know that the disk is 8GB, even if /proc/partitions says so. –  Jakob Weisblat Mar 22 '13 at 5:20
    
How canI make an 8GB partition? –  Jakob Weisblat Mar 22 '13 at 5:20
    
I just had to reboot before cfdisk recognized the size of the disk, or else I had to run it as root. I'm not sure if I ran it as root before rebooting. –  Jakob Weisblat Mar 22 '13 at 6:01
1  
@Jake223, you don't need to reboot: just replug flash. –  Eddy_Em Mar 22 '13 at 6:45
    
thanks @Eddy_Em –  Jakob Weisblat Mar 22 '13 at 7:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.