Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
After running fdisk or cfdisk to create a partition as suggested by Nylex, you can use the mkfs.vfat command. Be careful to specify -F32 on the command line, otherwise you will end up with a FAT12 or a FAT16 filesytem. Here is an excerpt from man mkfs.vfat explaining this issue:
Code:
-F FAT-size
Specifies the type of file allocation tables used (12, 16 or 32 bit).
If nothing is specified, mkdosfs will automatically select between
12 and 16 bit, whatever fits better for the file system size.
32 bit FAT (FAT32 format) must (still) be selected explicitly
if you want it.
Is not there graphic based more safe way to do this ?, one have to be very careful of will format wrong drive .
If your main concern is about partitioning you can always use gparted to partition the pen drive. Then go to the command line to run the mkfs.vfat command only.
About fdisk usage, don't be afraid. Just read a good tutorial about partitioning using fdisk (plenty of them online, but you can start from the official Partition HOWTO) then first check the list of drives using
Code:
# fdisk -l
Disk /dev/hdc: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 * 1 26 208813+ 83 Linux
/dev/hdc2 27 392 2939895 83 Linux
/dev/hdc4 393 14946 116905005 f W95 Ext'd (LBA)
/dev/hdc5 393 1667 10241406 83 Linux
/dev/hdc6 1668 1928 2096451 82 Linux swap / Solaris
/dev/hdc7 1929 2183 2048256 83 Linux
/dev/hdc8 2184 2221 305203+ 83 Linux
/dev/hdc9 2222 14946 102213531 83 Linux
Disk /dev/sda: 2055 MB, 2055208960 bytes
255 heads, 63 sectors/track, 249 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 250 2007008+ 6 FAT16
This is an example of a list on my current machine with a 2Gb pen drive inserted. You can easily locate the name of the device looking at its size (highlighted in red in the example above). Then simply run the command
Code:
fdisk name_of_the_device
then type the relevant interactive commands to create a partition on that device. In my example above the command would have been fdisk /dev/sda. Most likely on your system /dev/sda is the main disk, so you will have the pen drive as /dev/sdb OR /dev/sdc and so on. If you double check the fdisk command line before pressing enter, you can safely proceed being sure the other drives rest untouched.
formating it to FAT32 gives "FAT32 is not supported by your system" when reinserted. So can I use ex2 will it work on any windos sys ? Why I always have one "lost+found" folder on pendrive ? it is of 1025MB (1GB) but it always show 49MB used ???
formating it to FAT32 gives "FAT32 is not supported by your system" when reinserted.
Which exact command line did you issued to format the pen drive to fat32? Also to be more helpful, let us see the output of fdisk -l with the pen drive inserted.
Quote:
So can I use ex2 will it work on any windos sys ? Why I always have one "lost+found" folder on pendrive ? it is of 1025MB (1GB) but it always show 49MB used ???
ext2 filesystem can be managed by windows if you have a ext2/ext3 tool installed. One of the most reliable is Ext2IFS and it has full plug-n-play functionality.
The lost+found directory is always created on a ext2/ext3 filesystem. It is the place where chunks of corrupted files are stored in order to rescue them. Regarding the used space, it is normal that the filesystem reserves some space for its functionality. The used space increases when the filesystem uses journaling: this is the default for ext3 formatting but can be explicitly set for ext2 as well.
Just out of curiosity, where did we get the notion that Debian doesn't support Fat32? I used gparted to format my pendrive to Fat32, and it's readable in windows, mac, debian, ubuntu, gentoo...etc.
There are actually many ways of formatting a USB flash drive in Linu
The quick 'n' easy way:
First establish what your stick is. It'll probably be sda1 - but check anyway by looking at the results of the following command (you need to be root to do this):
# fdisk -l
Assuming it is sda1, you'll need to unmount the flash disk, so:
# umount /dev/sda1
Once done, enter the following command to format the flash device to FAT32
# mkdosfs -F 32 -I /dev/sda1
Needless to say, you'll lose everything on the disk so be sure that sda1 really is the flash disk in question! Best switch off any external drives first, just to be sure!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.