[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: USB key and lost space



Hi,

Rodary Jacques wrote:
> I don't quite know how, but with fdisk, cfdisk, parted, partx and partprobe
> I now have a brand new key with 16 GB (or GiB), the original size, without
> the iso file,
> [...]
> But the one with netinst iso (with the two partitions) seem to be much
> harder.
> [...]
> 'wipefs /dev/sde' continue to read:
> [...]
> 0x8001               iso9660   [filesystem]
>                     LABEL: Debian 9.3.0 amd64 n

Originally you asked:
> > On  several USB keys used for installation (or try of) I copied iso files of
> > more or less  MB, and the remaining space (of 15 or 31MB is inaccessible

This is a different job than removing an installation ISO from a USB stick
or memory card.

To erase the ISO 9660 superblock of debian-9.3.0-amd64-netinst.iso do

  umount /dev/sde1
  dd if=/dev/zero bs=2048 seek=16 count=4 conv=notrunc of=/dev/sde

But first make sure that /dev/sde is indeed the medium you want to erase.
Device names can change on unplug and replug.


I really wonder what the regular use case of wipefs is. Its man page
looks confusing:

   wipefs can erase filesystem , raid or partition-table signatures (magic
   strings) from the specified device to make the signatures invisible for
   libblkid.
   wipefs does not erase the filesystem itself [...]

Removing "signatures" quite surely damages the mountability. It looks like
this tool is intended to create confusion about disk content.


> mount says "/dev/sde1 on /media/jr/NIKON D7100
> type vfat (ro, etc..." which is correct except for the ro!

So partition 1 now marks a block range with a FAT filesystem.

What does a partition editor (not wipefs) say about partitions ?


> How can I force the kernel to forget this 'read only' on the disk?

First you will have to find the reason.

It could be over-smartness because of the ISO 9660 superblock which
is now iprobably valid only if read from the base device.

It could be lack of rw-permission on /dev/sde1.


In worst case you will have to overwrite the first MB and the last MB of
/dev/sde and then partition it again. All filesystem content will become
inaccessible then.

But for now, try to get rid of ISO 9660, unplug, replug, and see what
happens. Especially look at permissions of overall device file
(e.g. /dev/sde) and partition device files (e.g. /dev/sde1).


Have a nice day :)

Thomas


Reply to: