1) I would like to copy a single file from Ubuntu 18.04's ext4-formatted partition to Window 10's NTFS-formatted partition without going through an intermediate FAT32 partition. Can the "dd" command in Ubuntu do that? What "mount" commands might be needed to do that?
dd does not care about partitions or filesystems. Its input and output are ordinary files, and the only thing it does is copy data, byte-by-byte (or chunk-by-chunk) from its input to its output.
In your situation, dd isn't any more useful than regular cp or even cat. After you have mounted both the source ext4 partition and the destination NTFS partition on Linux, you can just... copy the files using cp or other regular tools or even using a graphical file manager.
To mount an NTFS filesystem with read/write features, install ntfs-3g. No special options are needed from the Linux side (generally), but if this is an internal disk, you do need to make sure Windows has fully unmounted it during shutdown – i.e. hasn't gone into 'hibernate' or 'hybrid' or 'fast startup' mode.
(For example, you can use shutdown /s /t 0 from Windows in order to begin a full shutdown.)
2) If the source is a block of bytes rather than a file, can "dd" transfer those bytes to a file format in the NTFS-formatted partition? (I'm trying to set up the "\linux.bin" file with Window's BCDedit to dual-boot to Ubuntu, as in: bcdedit /set {long id here} path C:\linux.bin where dd's if= is a sector of 512 bytes.)
Same answer as before. dd does not understand filesystems; it just copies files. So if the output needs to be a file on NTFS, you must mount the NTFS filesystem within Linux itself, and then dd will simply write to the file you give it.
So just mount the NTFS partition like you did in part 1 above, and use dd if=/dev/xxx of=/mnt/windows/linux.bin bs=... count=... to copy the bootcode.
The sector size is irrelevant to the final data. It only tells dd how large a chunk to read at once – e.g. reading a single 512-byte chunk is much faster than reading 512 one-byte chunks, but the resulting data will be identical either way.
(That is, dd if=A of=B bs=1 count=512 and dd if=A of=B bs=512 count=1 will create identical files, just doing it at different speeds.
In fact, head -c 512 A > B will create an identical file to both.)
countyou may not get identical files. You will be surprised ifddreads a partial input block. This will still count as a successful read but it will provide less thanibsdata. In effect, when you reachcountyou will not reach the amount of data you wanted. I have never seen this while reading from a local filesystem, but in general (pipes, named pipes, network mounts?, FUSE?) you neediflag=fullblock. Proof of concept:</dev/zero dd bs=1 | dd bs=4M count=2 | wc -c. – Kamil Maciorowski Nov 19 '18 at 06:39dd if=…, as well as the destination, is always a named file. It might be a virtual "device" file provided by the kernel, but as far as dd knows, it's still just a file. dd never adds any metadata. dd never adds any record structure. dd does not understand filesystems. The only way to make dd create a file on NTFS is to mount the NTFS filesystem globally. – u1686_grawity Nov 19 '18 at 10:56