Linux Commands to Create NTFS Filesystem on USB Stick
First, the stick should be in, but not mounted. If it is mounted, find the partition represented by your usb stick, as such:
[0959][scott@laptop:~]$ mount/dev/sda2 on / type ext3 (rw,acl,user_xattr)/proc on /proc type proc (rw)sysfs on /sys type sysfs (rw)debugfs on /sys/kernel/debug type debugfs (rw)udev on /dev type tmpfs (rw)devpts on /dev/pts type devpts (rw,mode=0620,gid=5)/dev/sda1 on /windows/C type fuseblk (rw,allow_other,blksize=4096)fusectl on /sys/fs/fuse/connections type fusectl (rw)none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)gvfs-fuse-daemon on /home/scott/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=scott)/dev/sdc1 on /media/disk-1 type vfat (rw,nosuid,nodev,shortname=winnt,uid=1000)/dev/sdb1 on /media/disk-2 type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=1024)[0959][scott@laptop:~]$
It will likely be a /dev/sdxx type device. In this case, the one I’m looking for is sdb1.
We need to unmount it as root (’su’):
laptop:/home/scott # umount /dev/sdb1laptop:/home/scott #
Now, fdisk the usb stick, and not the partition. In other words, leave off the trailing digit:
laptop:/home/scott # fdisk /dev/sdbCommand (m for help):
Press ‘p’ to view the partitions on the drive. Delete all partitions. Create a new one with ‘n’. It will be a primary partition, and it will be partition 1. Now, we need to set the filesystem type. Press ‘t’, and then if you’d like to see all the filesystem types, press ‘L’, but I’ll just tell you that NTFS is 7. Press ‘7′, and then ‘w’ to write the partition table, and exit:
Command (m for help): pDisk /dev/sdb: 1027 MB, 1027604480 bytes64 heads, 32 sectors/track, 980 cylindersUnits = cylinders of 2048 * 512 = 1048576 bytesDisk identifier: 0x610fbfb2 Device Boot Start End Blocks Id System/dev/sdb1 * 1 980 1003504 c W95 FAT32 (LBA)Command (m for help): dSelected partition 1Command (m for help): nCommand action e extended p primary partition (1-4)pPartition number (1-4): 1First cylinder (1-980, default 1):Using default value 1Last cylinder, +cylinders or +size{K,M,G} (1-980, default 980):Using default value 980Command (m for help): tSelected partition 1Hex code (type L to list codes): 7Changed system type of partition 1 to 7 (HPFS/NTFS)Command (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.laptop:/home/scott #Now, we need to actually format the new partition. Include the partition number at the end. It should be 1. You will do this as root (’su’), like so:
laptop:/home/scott # mkntfs /dev/sdb1Cluster size has been automatically set to 1024 bytes.Initializing device with zeroes: 100% - Done.Creating NTFS volume structures.mkntfs completed successfully. Have a nice day.laptop:/home/scott #
K, well, there you are. Mount it up any way you see fit, and you are all set.
Read More...
[Source: Linux Blogs2k - Posted by FreeAutoBlogger]

