a1ive / grub

Fork of GRUB 2 to add various features.
GNU General Public License v3.0
138 stars 38 forks source link

Question: dd status=progress? #81

Closed DapperDeer closed 3 years ago

DapperDeer commented 4 years ago

Hi there,

I was wondering if there is an equivalent to status=progress for this dd? Or if it is possible to add it?

Thanks

a1ive commented 4 years ago
export enable_progress_indicator=1
dd --if=(hd0,1) --of=(hd0,2) bs=512
DapperDeer commented 4 years ago

Heya,

dd isn't working for me and I'm really confused as to why.

The commands that I've tried are: dd --if=(hd0) --seek=2048 --of=(hd0) --skip=88082432 -b 4096 -c 20479 dd --if=(hd0,msdos3) --of=(hd0,msdos1) -b 4096 dd --if=(hd0,3) --of=(hd0,1) -b 4096

All three commands don't return anything and I have entered export enable_progress_indicator=1 before trying any of the commands. The drive I'm trying to dd is NTFS and I've insmod ntfs and insmod part_msdos

Thanks

Edit: I just want to mention that I am trying to overwrite a 40GB partition. The commands return almost instantaneously, which is why I believe nothing is happening. Trying dd with a much smaller sample size (6 bytes) also returns nothing but hexdump shows that it is working.

steve6375 commented 4 years ago

MBR/legacy, uefi32 or uefi64 boot to grub2?

DapperDeer commented 4 years ago

MBR/Legacy

steve6375 commented 4 years ago

Ok, 6 bytes works but 40gb does not. What about sizes in between? E.g .1000 blocks of size 4096?

DapperDeer commented 4 years ago

dd --if=(hd0) --seek=2048 --of=(hd0) --skip=88082432 -b 4096 -c 1000 worked. image

I did something similar with the 40GB overwrite and it did not work. Should I just do it in slices?

steve6375 commented 4 years ago

Well, I would start increasing -c until it started to fail. You may find that when you get to a certain size it will fail. e.g. -c 65536
then it would point to a number\integer size issue.

a1ive commented 4 years ago

I think it's an overflow bug. https://github.com/a1ive/grub/blob/4966126acb4ccdb4c4ca1db57d487e2786060ed4/grub-core/commands/dd.c#L88 But I strongly discourage writing large amounts of data with dd under BIOS.