Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am using gParted to format a new USB (external) drive I purchased. It is a 320GB drive which "dmesg" sees no problem.
Code:
usb-storage: waiting for device to settle before scanning
Vendor: USB 2.0 Model: Storage Device Rev: 0111
Type: Direct-Access ANSI SCSI revision: 00
SCSI device sdb: 625142448 512-byte hdwr sectors (320073 MB)
sdb: Write Protect is off
sdb: Mode Sense: 08 00 00 00
sdb: assuming drive cache: write through
SCSI device sdb: 625142447 512-byte hdwr sectors (320073 MB)
sdb: Write Protect is off
sdb: Mode Sense: 08 00 00 00
sdb: assuming drive cache: write through
sdb: unknown partition table
sd 5:0:0:0: Attached scsi disk sdb
usb-storage: device scan complete
I see the drive is /dev/sdb so I go to gParted and I only have the option to format the drive as the following:
- EXT2
- EXT3
- Swap
- Unformatted
I do see in the format options list for FAT and others but they are greyed out and I can't select them for some strange reason. Am I missing something? I would like to format the drive as FAT so Linux and Windows can read the drive in case an emergency.
Sounds like another CHS geometry problem to me. Plus that drive is too big for a single FAT16 partition anyway, so I'd expect that option to be greyed out.
Anyway, FAT32 probably needs something like XXXXX/255/63 and Linux didn't see it that way. That's why I always initialize and create at least the first partition in Windows, just to make sure I get a good (cross-platform compatible) partition table written. Then I do all my formatting and adjusting of partition sizes with gparted.
So what would the command look like to format /dev/sdb?
I usually like to try all of the commands before I provide a recipe, but it this case, I don't have a drive available to test without losing data. Having said that, this is the basic procedure, with apologies if I've overlooked something. Since you are starting with new media, there shouldn't be a risk of data loss.
First,
Code:
man fdisk, &
man mkfs.
You need to create the partition(s) using fdisk.
As root,
Code:
fdisk /dev/sdb
use 'n', to create a new partiton, and enter partiton size & type parameters as desired.
use 'w' to write the partition table to the media. Repeat until all sectors used, or enough partitions created.
Again, as root,
Code:
mkfs -t vfat /dev/sdb1
Repeat as necessary, for any adiditional partitions.
I forget the maximum size of fat32 partitions, but as Crito mentions, you may bump into that limit.
After creating the filesystem(s), they can be mounted, using mount.
My only problem is in "fdisk", I don't know how to use all the available disk space. I know I can do +320000M for 320GB drive but drives are always less than advertised. Is there no way in fdisk to use all available space in one partition?
Well, my fdisk first queries for a beginning cylinder number (default=1), and then for a ending cylinder number (defualt=last cyl.). If you want, you can use the 'p' command to print the disk geometry for you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.