Closed steve6375 closed 4 years ago
I want to write a string (the value of a variable) into an existing file (NTFS or FAT).
dd --str=STRING --of=...
now you can use (proc) as /dev/zero. disk size is 2TB (UINT32_MAX).
Thanks! When booting WinPE ISOs that have been made using WinBuilder, they look for an INI file in the root of all drives.
I have added some code to my map.sh and now Gandalf WinPE boots correctly using map (no yellow triangle on Desktop and apps work).
My first partition has all three .ini files WinBuilder INI files.zip
loopback -d loop;
loopback loop "${grubfm_file}";
set installiso="${grubfm_path}";
tr --set=installiso "/" "\\";
set "iso1=[IsoInfo]\x0d\x0aIsoName=${installiso}\x0d\x0a"
if [ -f (loop)/CdUsb.Y -o -f (loop)/Win10PE.cd -o -f (loop)/Win8PE.cd ] ; then
echo Info: WinBuilder ISO detected!
if [ -f (hd0,msdos1)/Win10PESE.ini ] ; then dd --if (proc) --of=(hd0,msdos1)/Win10PESE.ini ; dd -s "$iso1" --of=(hd0,msdos1)/Win10PESE.ini ; fi
if [ -f (hd0,msdos1)/Win8PESE.ini ] ; then dd --if (proc) --of=(hd0,msdos1)/Win8PESE.ini ; dd -s "$iso1" --of=(hd0,msdos1)/Win8PESE.ini ; fi
if [ -f (hd0,msdos1)/Win7PESE.ini ] ; then dd --if (proc) --of=(hd0,msdos1)/Win7PESE.ini ; dd -s "$iso1" --of=(hd0,msdos1)/Win7PESE.ini ; fi
#grubfm_hex (hd0,msdos1)/Win7PESE.ini
unset iso1
fi
P.S. dd seems very slow when using (proc) ???
P.S. dd seems very slow when using (proc) ???
If you are trying to dd a file, grub2 will convert file to blocklists.
yes, as in example code above.
If (hd0,1) is fat, why not use fatfs create file and write?
set installiso="${grubfm_path}";
tr --set=installiso "/" "\\";
set "iso1=[IsoInfo]\x0d\x0aIsoName=${installiso}\x0d\x0a";
mount (hd0,1) 1;
touch 1:/Win10PESE.ini;
write_file 1:/Win10PESE.ini "${iso1}";
Because the files are already in partition 1 as part of easy2boot. agFM is an optional extra.
As long as (hd0,1) is FAT, you could use write_file
rather than dd
.
It is usually NTFS
I want to write all 00's to an existing NTFS file to fill it with 00's. Does dd support something like --if=/dev/zero ? Also, I want to write a string (the value of a variable) into an existing file (NTFS or FAT). Is there a way to do this?