Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #270474

Re: how2 format a flash drive

From "Thomas Schmitt" <scdbackup@gmx.net>
Newsgroups linux.debian.user
Subject Re: how2 format a flash drive
Date 2024-06-25 18:30 +0200
Message-ID <IThdn-5wpG-7@gated-at.bofh.it> (permalink)
References <ITfEB-5v60-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

David Wright wrote:
> Of course, we're not told what "normal" means,

I guess it's a single partition with FAT.
Around 2010 i got three USB sticks and kept their compressed original
content. For examination of their MBR partition tables it is enough to
cut off their heads:

  $ gunzip <usb_2gb_original.gz | dd bs=512 count=1 of=x.img
  ...
  $ /sbin/fdisk -l x.img
  ...
  Device     Boot Start     End Sectors  Size Id Type
  x.img1     *       32 3915775 3915744  1.9G  6 FAT16

The other two have

  Device     Boot Start     End Sectors  Size Id Type
  x.img1             38 7839719 7839682  3.8G  b W95 FAT32

  Device     Boot Start      End  Sectors  Size Id Type
  x.img1     *       63 15794175 15794113  7.5G  b W95 FAT32

The types do not necessarily tell the actual filesystem type.
But since that was the initial partitioning, i trust them and do not
uncompress the whole images in order to inspect them.


> what was tried, nor how normality was tested.

Yeah. More tangible info would help with helping.


> It's possible that they need to
> use, say, mkdosfs to get back to the state in which USB sticks
> are typically bought, so it can be plugged into other devices.

Since at least a decade, "man mkdosfs" describes "mkfs.fat".

But before creating a new filesystem, it is necessary to create a
suitable partition for hosting it.
An USB stick with the netinst ISO shows two partitions:

  $ /sbin/fdisk -l debian-12.2.0-amd64-netinst.iso

  Disk debian-12.2.0-amd64-netinst.iso: 628 MiB, 658505728 bytes, 1286144 sectors
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disklabel type: dos
  Disk identifier: 0x52bf7ba9

  Device                           Boot Start     End Sectors  Size Id Type
  debian-12.2.0-amd64-netinst.iso1 *        0 1286143 1286144  628M  0 Empty
  debian-12.2.0-amd64-netinst.iso2       4476   23451   18976  9.3M ef EFI (FAT-12

Partition editors might react unfriendly on the "Empty" partition which
surrounds the EFI partition. The latter has a FAT filesystem which is
completely filled up:

  $ sudo mount offset=2291712 /mnt/fat
  $ df /mnt/fat
  Filesystem     1K-blocks  Used Available Use% Mounted on
  /dev/loop0          9450  9446         4 100% /mnt/fat

The files in this FAT are the initial boot stages for amd64 and i386:

  $ find /mnt/fat -type f
  /mnt/fat/efi/boot/bootx64.efi
  /mnt/fat/efi/boot/grubx64.efi
  /mnt/fat/efi/boot/bootia32.efi
  /mnt/fat/efi/boot/grubia32.efi
  /mnt/fat/efi/debian/grub.cfg

Their only purpose is to convince Secure Boot that the GRUB software is
acceptable and to find the ISO filesystem where the rest of GRUB's
equipment is stored.

So both partitions are of no use for the general purpose USB stick
and can be deleted.


Have a nice day :)

Thomas

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

how2 format a flash drive Lee <ler762@gmail.com> - 2024-06-25 16:00 +0200
  Re: how2 format a flash drive "Thomas Schmitt" <scdbackup@gmx.net> - 2024-06-25 16:30 +0200
    Re: how2 format a flash drive David Wright <deblis@lionunicorn.co.uk> - 2024-06-25 16:50 +0200
      Re: how2 format a flash drive "Thomas Schmitt" <scdbackup@gmx.net> - 2024-06-25 18:30 +0200
        Re: how2 format a flash drive "Thomas Schmitt" <scdbackup@gmx.net> - 2024-06-25 18:50 +0200
      Re: how2 format a flash drive eben@gmx.us - 2024-06-25 19:20 +0200
        Re: how2 format a flash drive David Wright <deblis@lionunicorn.co.uk> - 2024-06-26 01:00 +0200
    Re: how2 format a flash drive Lee <ler762@gmail.com> - 2024-06-25 21:40 +0200
  Re: how2 format a flash drive Joe <joe@jretrading.com> - 2024-06-25 17:50 +0200
    Re: how2 format a flash drive Hans <hans.ullrich@loop.de> - 2024-06-25 18:50 +0200
      Re: how2 format a flash drive Lee <ler762@gmail.com> - 2024-06-26 01:30 +0200
    Re: how2 format a flash drive Lee <ler762@gmail.com> - 2024-06-25 21:50 +0200
      Re: how2 format a flash drive eben@gmx.us - 2024-06-25 22:20 +0200
      Re: how2 format a flash drive George at Clug <Clug@goproject.info> - 2024-06-26 01:30 +0200
        Re: how2 format a flash drive sd@swampdog.co.uk - 2024-06-27 15:30 +0200
        Re: how2 format a flash drive Lee <ler762@gmail.com> - 2024-06-29 18:50 +0200
          Re: how2 format a flash drive Dan Ritter <dsr@randomstring.org> - 2024-06-29 19:40 +0200
            Re: how2 format a flash drive Lee <ler762@gmail.com> - 2024-07-01 04:40 +0200
              Re: how2 format a flash drive jeremy ardley <jeremy.ardley@gmail.com> - 2024-07-01 07:50 +0200
                Re: how2 format a flash drive Lee <ler762@gmail.com> - 2024-07-01 15:10 +0200
                Re: how2 format a flash drive <tomas@tuxteam.de> - 2024-07-01 15:50 +0200
                Re: how2 format a flash drive jeremy ardley <jeremy.ardley@gmail.com> - 2024-07-01 21:30 +0200
                Re: how2 format a flash drive Stefan Monnier <monnier@iro.umontreal.ca> - 2024-07-02 05:50 +0200
                Re: how2 format a flash drive gene heskett <gheskett@shentel.net> - 2024-07-02 06:10 +0200
                Re: how2 format a flash drive <tomas@tuxteam.de> - 2024-07-02 06:40 +0200
                Re: how2 format a flash drive George at Clug <Clug@goproject.info> - 2024-07-02 06:50 +0200
                Re: how2 format a flash drive Jeffrey Walton <noloader@gmail.com> - 2024-07-02 10:20 +0200
                Telemetry, data hoarding [was: how2 format a flash drive] <tomas@tuxteam.de> - 2024-07-02 10:30 +0200
                Re: how2 format a flash drive jeremy ardley <jeremy.ardley@gmail.com> - 2024-07-02 11:20 +0200
                Re: how2 format a flash drive John Hasler <john@sugarbit.com> - 2024-07-02 17:20 +0200
                Re: how2 format a flash drive Lee <ler762@gmail.com> - 2024-07-02 10:30 +0200
                Re: how2 format a flash drive jeremy ardley <jeremy.ardley@gmail.com> - 2024-07-02 11:30 +0200
                Re: how2 format a flash drive Lee <ler762@gmail.com> - 2024-07-02 22:40 +0200
          Browser traffic interception/inspection (was: how2 format a flash drive) Jeffrey Walton <noloader@gmail.com> - 2024-06-29 22:50 +0200
            Re: Browser traffic interception/inspection Max Nikulin <manikulin@gmail.com> - 2024-06-30 03:40 +0200
              Re: Browser traffic interception/inspection Jeffrey Walton <noloader@gmail.com> - 2024-06-30 08:00 +0200
                Re: Browser traffic interception/inspection Max Nikulin <manikulin@gmail.com> - 2024-06-30 17:40 +0200
                Re: Browser traffic interception/inspection Lee <ler762@gmail.com> - 2024-07-01 09:00 +0200
                Re: Browser traffic interception/inspection Max Nikulin <manikulin@gmail.com> - 2024-07-01 17:10 +0200
                Re: Browser traffic interception/inspection Lee <ler762@gmail.com> - 2024-07-07 23:50 +0200
                Re: Browser traffic interception/inspection Max Nikulin <manikulin@gmail.com> - 2024-07-08 04:40 +0200
                Re: Browser traffic interception/inspection Lee <ler762@gmail.com> - 2024-07-08 16:30 +0200
            Re: Browser traffic interception/inspection (was: how2 format a flash drive) Lee <ler762@gmail.com> - 2024-07-01 03:40 +0200
              Re: Browser traffic interception/inspection (was: how2 format a flash drive) Jeffrey Walton <noloader@gmail.com> - 2024-07-01 03:50 +0200
                Re: Browser traffic interception/inspection (was: how2 format a flash drive) Jeffrey Walton <noloader@gmail.com> - 2024-07-01 07:50 +0200
          Re: how2 format a flash drive Keith Bainbridge <keithrbau@gmail.com> - 2024-06-30 08:20 +0200
          Re: how2 format a flash drive Jeffrey Walton <noloader@gmail.com> - 2024-07-01 08:00 +0200
  Re: how2 format a flash drive Marc SCHAEFER <schaefer@alphanet.ch> - 2024-07-06 17:50 +0200

csiph-web