-
-
Save ross-spencer/35dfcd390dc067a98509084e89139d2a to your computer and use it in GitHub Desktop.
How To Create a NTFS Image File in Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
image="test.img" | |
label="test" | |
mntdir=`mktemp -d` | |
sudo dd status=progress if=/dev/zero of=$image bs=6M count=1000 && sync | |
echo 'type=7' | sudo sfdisk $image | |
LOOPMOUNT=`sudo losetup --partscan --show --find ${image}` | |
echo $LOOPMOUNT | |
sudo mkfs.ntfs -Q -v -F -L ${label} ${LOOPMOUNT}p1 | |
sudo mount ${LOOPMOUNT}p1 ${mntdir} | |
# Now you can put some files to ${mntdir} | |
sudo umount ${mntdir} | |
sudo losetup -d ${LOOPMOUNT} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://en.m.wikipedia.org/wiki/NTFS
PowerShell 3.0, it is possible to manage ADS natively with six cmdlets: Add-Content, Clear-Content, Get-Content, Get-Item, Remove-Item, Set-Content.[63]