OpenSUSE Linux Tips, tricks, how-tos, opinions, and news
My Resume - My LinkedIn Profile - twitter: @scottmmorrisFirst, 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/sdb1 laptop:/home/scott #
Now, fdisk the usb stick, and not the partition. In other words, leave off the trailing digit:
laptop:/home/scott # fdisk /dev/sdb Command (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): p
Disk /dev/sdb: 1027 MB, 1027604480 bytes
64 heads, 32 sectors/track, 980 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk identifier: 0x610fbfb2
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 980 1003504 c W95 FAT32 (LBA)
Command (m for help): d
Selected partition 1
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-980, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-980, default 980):
Using default value 980
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 7
Changed system type of partition 1 to 7 (HPFS/NTFS)
Command (m for help): w
The 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/sdb1 Cluster 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.
If you enjoyed this post, make sure you subscribe to my RSS feed!| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| « Aug | ||||||
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | ||
33 queries. 0.662 seconds
April 29th, 2009 at 12:27 pm
Thanks. Nice and easy method regardless of distro.
July 14th, 2009 at 10:09 am
I prefer larger blocks and disabled indexing on flash disk to increase free space, because I use my stick mainly to transfer large iso images
The -f switch skips the time consuming fill with zeroes, which really speeds up the process of creating ntfs and it’s not really necessary at all
# sudo mkntfs -f -I -v -c 32768 /dev/sdb1
Other optimization to increase the free space by 62MB is to decrease the ntfs log size, which is normally set to 64MB on larger drives. This cannot be set under linux, but on windows XP it can be adjusted with the following command:
> chkdsk f: /L:2048
Have fun
July 22nd, 2009 at 1:52 am
What are the advantages vs disadvantages of using NTFS over FAT on a usb stick?
February 12th, 2010 at 8:08 am
The advantages of using NTFS over FAT on a USB stick is that you are limited to a file size of 4 GB on FAT. If you wish to use your USB stick to do something like transfer ISO images, which can be larger than 4 GB, you need the NTFS file system.
March 13th, 2010 at 11:31 pm
Thanks for this. Couldn’t do it in Gparted!
April 14th, 2010 at 12:55 pm
marquis@marquis-desktop:~$ umount /dev/sdc1
marquis@marquis-desktop:~$ fdisk /dev/sdc
Unable to open /dev/sdc
i keep getting this after trying to fdisk ?