Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1417  / 1 Year ago, fri, march 10, 2023, 6:48:05

It might look like an easy thing to do, but I'm experiencing problems in formatting a USB drive so it can be used in Live format. I've used 8 and 16GB USB drives, with the same result. Here's what I do:




  1. unmount the drive: sudo umount /dev/sdb

  2. format the drive: sudo mkfs.vfat -I /dev/sdb

  3. partitioning the drive: sudo fdisk /dev/sdb, followed by this sequence of commands: n p 1 [intro] +7G a w



The process seems to work fine, and it exists with the message:



The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.


(Also tried +4G, and changing to FAT16 and FAT32, same result.)



lsblk now shows this information:



NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda 8:0 0 238,5G 0 disk
├─sda1 8:1 0 226,6G 0 part /
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 11,9G 0 part [SWAP]
sdb 8:16 1 14,5G 0 disk
└─sdb1 8:17 1 7G 0 part
sr0 11:0 1 1024M 0 rom


I take the drive out and plug it again, but nothing happens. The drive is not automatically mounted, as expected, and it does not show up when I run unetbootin (typically there I can see the sdb or the sdb1 drives that come already installed in a new USB drive).



So, at this point I don't know how to proceed. When I create the Live version in a drive that has not been partitioned (writing to sdb) and try to boot with it, it will say that the drive is not a bootable one.



Have made an extensive search in this and other forums (including this), but can't find the right information.


More From » boot

 Answers
1

Your procedure was (in part):




  1. format the drive: sudo mkfs.vfat -I /dev/sdb

  2. partitioning the drive: sudo fdisk /dev/sdb



There are two things wrong with this:




  • Order reversal -- You need to partition the disk before you create a filesystem on ("format") it. This is because partitions hold filesystems, so partitions must exist before filesystems are created. You ended up with a partition that pointed to some semi-random part of the disk rather than to the start of a filesystem.

  • Whole-disk filesystems -- As just noted, partitions hold filesystems; however, you created a filesystem on the whole-disk device (/dev/sdb), rather than on a partition on the device (such as /dev/sdb1). This said, though, putting a filesystem on a whole-disk device is legal; it's just customary to put filesystems in partitions, and doing so increases flexibility. It's conceivable that it would have worked if you'd omitted step #3; but it's also possible that some of the tools or setup you want to create would assume that the disk is partitioned, in which case omitting step #3 would have led to problems later on.



When you used GParted, as GTRONICK suggested, you bypassed both of these problems, because GParted performs the partitioning and filesystem-creation tasks in the correct order, and puts filesystems on the partitions it creates. (The GParted user interface hides the fact that there are two operations, but they are two distinct operations, behind the scenes.)


[#11362] Saturday, March 11, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bblerest

Total Points: 240
Total Questions: 119
Total Answers: 113

Location: Wallis and Futuna
Member since Mon, May 18, 2020
4 Years ago
bblerest questions
Sun, Apr 16, 23, 13:50, 1 Year ago
Fri, Nov 4, 22, 06:21, 2 Years ago
Tue, Sep 27, 22, 12:22, 2 Years ago
;