Results 1 to 8 of 8
Hi
I'm a linux user for some time now and most stuff I can figure out myself. Though, this one drives me crazy and I did not find any information ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-20-2009 #1Just Joined!
- Join Date
- Aug 2009
- Location
- Wil, Switzerland
- Posts
- 10
Copy of a partition using dd gets bigger than the original partition
Hi
I'm a linux user for some time now and most stuff I can figure out myself. Though, this one drives me crazy and I did not find any information on the internet.
I have a partition, say,, which is 128MB big. When I copy it usingCode:/dev/sda1
, the resulting file is 134MB big. Now my problem is that I want to copy that partition as-is to a CF card, which does not work because the image is bigger than the partition on the CF card.Code:dd if=/dev/sda1 of=/home/me/backup_sda1.img
Why does dd create bigger files? Shouldn't it be exactly same sized like the source?
Thanks
- 08-20-2009 #2
are you sure, that the partiton itself is 128MB?
Or does the _file_system_ report 128MB total?
In the later case, the partition would logically be bigger.
what does fdisk -l /dev/sda say?
- 08-20-2009 #3Just Joined!
- Join Date
- Aug 2009
- Location
- Wil, Switzerland
- Posts
- 10
> are you sure, that the partiton itself is 128MB?
hm.. not anymore, no...
/dev/sda1 seems to be bigger than 128M. I've used fdisk to partition it and there I said "+128M", so I'm not sure why it's over 130M.Code:moon ~ # df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda3 3548952 2072076 1286908 62% / udev 10240 136 10104 2% /dev /dev/sda1 132206 8127 117253 7% /boot shm 30024 0 30024 0% /dev/shm
The same is with all other partitions, they're slightly bigger than what I've told fdisk.
Strange. So the problem lies in the partition size, not dd. Should have figured out this by myself.
- 08-20-2009 #4
afaik,
fdisk (or any other partitioner) has to round up the user input,
so that it matches the harddisc geometry.
Rounds up to.. a full cylinder? But I could be wrong with "cylinder" here.
- 08-20-2009 #5Just Joined!
- Join Date
- Aug 2009
- Location
- Wil, Switzerland
- Posts
- 10
Hmm. yeah. Dunno if it's cylinder, but I thought it'll round DOWN, not up. It's kinda strange though. I created the partition on the CF card the same way, so I thought it'll be the same size then. But maybe the CF card has 128M now (can't check right now) because fdisk hadn't to round it up because it's not a mechanical hard drive.
- 08-20-2009 #6Just Joined!
- Join Date
- Oct 2007
- Posts
- 15
Ntfs & ext3
can you please run :
If you notice that the file you are copying is under NTFS file system and copied to EXT3 file system, it is normal to notice increase of file size as journaling files are created. Try then copied to EXT2 ,NTFS ,FAT32 or FAT to avoid file system journals beaing created.Code:fdisk -l
Maybe there are some options on dd to order it not to create file systems files.
cheers !
- 08-21-2009 #7
sorry, but
1) ntfs does have a journal
2) it was already determined that the partition on the harddisc is bigger than 128MB
3) dd does not care about filesystems. So there are no fs options to it
- 08-24-2009 #8Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
The file system is a non-issue. This is raw access.
Possible issues are missaligned partitions and GiB (base 2, multiples of 1024) vs GB (base 10, multiples of 1000). This happens because each program counts in a different way, whatever its author thinks is cooler.
The + sign (it could be a - as well) in fdisk means that rounding has taken place. Fdisk counts blocks, disk controllers count sectors.


Reply With Quote
