SD usable in Window, not in Leap

I bought a Kingston 120 GB micro SD card today. Leap reports it is read-only and fdisk, gdisk and dd all respond the same. It works with Windows 10 which I truly hate to boot. I used the Gibson Reasearch utility InitDisk to wipe it clean and nothing changed. Is there now a Windows-only lock on hardware? Nothing on the package says that. This link reports the same problem.

https://linustechtips.com/topic/448685-windows-only-sd-card/

There’s no point in trying to get a refund, because it will work on the seller’s Windows computer.

Hi
Why some third party tool? Have a look at wipefs?

What format is the filesystem, ntfs, exfat etc?

Maybe f or gdisk output on the device?

Is this going through a reader, what model?

is the write protect switch set to on? most SD have a write protect switch - set it the other way and see if that is it.

I didn’t know about wipefs.
File system was NTFS but after InitDisk it turned into FAT 32.
Trying wipefs, I got…

# wipefs --all /dev/sdbwipefs: error: /dev/sdb: probing initialization failed: Read-only file system

Then I get…

# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.37.4).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


fdisk: cannot open /dev/sdb: Read-only file system

And…

# gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.8


NOTE: Write test failed with error number 30. It will be impossible to save
changes to this disk's partition table!


Warning! Disk size is smaller than the main header indicates! Loading
secondary header from the last sector of the disk! You should use 'v' to
verify disk integrity, and perhaps options on the experts' menu to repair
the disk.
Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.


Warning! One or more CRCs don't match. You should repair the disk!
Main header: OK
Backup header: ERROR
Main partition table: OK
Backup partition table: ERROR


Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: damaged


Found valid MBR and corrupt GPT. Which do you want to use? (Using the
GPT MAY permit recovery of GPT data.)
 1 - MBR
 2 - GPT
 3 - Create blank GPT


Your answer: 2


Command (? for help): ?
b    back up GPT data to a file
c    change a partition's name
d    delete a partition
i    show detailed information on a partition
l    list known partition types
n    add a new partition
o    create a new empty GUID partition table (GPT)
p    print the partition table
q    quit without saving changes
r    recovery and transformation options (experts only)
s    sort partitions
t    change a partition's type code
v    verify disk
w    write table to disk and exit
x    extra functionality (experts only)
?    print this menu


Command (? for help): d
No partitions


Command (? for help): n
Partition number (1-128, default 1): 
First sector (34-250069646, default = 2048) or {+-}size{KMGTP}: 
Last sector (2048-250069646, default = 250069646) or {+-}size{KMGTP}: 
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): 
Changed type of partition to 'Linux filesystem'


Command (? for help): p
Disk /dev/sdb: 244328448 sectors, 116.5 GiB
Model: USB SD Reader   
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 94375FAF-72CB-45A0-AB11-E06C3F35867C
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 250069646
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)


Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048       250069646   119.2 GiB   8300  Linux filesystem


Command (? for help): w
Caution! Secondary header was placed beyond the disk's limits! Moving the
header, but other problems may occur!


Warning! Secondary partition table overlaps the last partition by
5741232 blocks!
You will need to delete this partition or resize it in another utility.


Problem: partition 1 is too big for the disk.
Aborting write operation!
Aborting write of new partition table.


Command (? for help): q
ion-office:/home/ion #

I also tried…

Found valid MBR and corrupt GPT. Which do you want to use? (Using theGPT MAY permit recovery of GPT data.)
 1 - MBR
 2 - GPT
 3 - Create blank GPT


Your answer: 1


Warning! Secondary partition table overlaps the last partition by
5736481 blocks!
You will need to delete this partition or resize it in another utility.


Command (? for help): q
ion-office:/home/ion # 

Bottom line…it still works in Windows and I gave up as it looks totally unusable in Linux. But I’ll be happy to try any new advice.

These filesystems seem to be messed up. I would try to simply reformat it with gparted and make sure none of the existing MBR / GPT is left.

One of the first utilities I used. Result…

# gparted /dev/sdb
GParted 1.4.0
configuration --enable-libparted-dmraid --enable-online-resize
libparted 3.5


(gpartedbin:3234): Gtk-WARNING **: 10:44:01.605: Theme parsing error: gtk.css:9228:21: Not using units is deprecated. Assuming 'px'.
Can't have a partition outside the disk!

Did you try to wipe the first part of the disk?

dd if=/dev/zero of=/dev/sdb count=10

Run these commands and post all as follows:

**erlangen:~ #** df -h /FR735/ 
Filesystem      Size  Used Avail Use% Mounted on 
/dev/sdc         11M  7.1M  3.1M  70% /FR735 
**erlangen:~ #** fdisk -l /dev/sdc 
**Disk /dev/sdc: 10.08 MiB, 10570752 bytes, 20646 sectors**
Disk model: FR735XT Flash    
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: 0x00000000 
**erlangen:~ #** lsblk -O /dev/sdc 
NAME KNAME PATH MAJ:MIN FSAVAIL FSSIZE FSTYPE FSUSED FSUSE% FSROOTS FSVER MOUNTPOINT MOUNTPOINTS LABEL UUID PTUUID PTTYPE PARTTYPE PARTTYPENAME PARTLABEL PARTUUID PARTFLAGS  RA RO RM HOTPLUG MODEL SERIAL  SIZE STATE OWNER GROUP MODE      
 ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED RQ-SIZE TYPE DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO WSAME WWN RAND PKNAME HCTL       TRAN SUBSYSTEMS  REV VENDOR ZONED DAX 
sdc  sdc   /dev/sdc 
                  8:32       3M    10M vfat       7M    70% /       FAT16 /FR735     /FR735      FR735                                                                       512  0  1       1 FR735 Garmin 10.1M runni root  disk  brw-rw----
         0    512      0     512     512    1 bfq         2 disk        0        0B       0B         0    0B        1        6:0:0:0    usb  block:scsi:usb:pci 
                                                                                                                                                                                                                                              
                                                                                                                                                        1.00 Garmin none    0 
**erlangen:~ #**

A 120 GB SD card is larger than 32 GB and, therefore, it doesn’t use FAT32.

  • It’s an SDXC card which, uses exFAT
    .

The exFAT support in the version 5.4 Kernel has been backported to the openSUSE version 5.3 Kernel –

  • The “exFAT
    ” driver should automatically load if, you plug in a USB device of more than 32 GB – here an example with a 64 GB SDXC card formatted by a digital camera –

 > lsmod | grep -i fat
vfat                   20480  1
fat                    90112  1 vfat
 > lsmod | grep -i fat
exfat                  81920  1
vfat                   20480  1
fat                    90112  1 vfat
 > 


 # modinfo exfat
filename:       /lib/modules/5.3.18-150300.59.76-default/kernel/fs/exfat/exfat.ko.xz
author:         Samsung Electronics Co., Ltd.
description:    exFAT filesystem support
license:        GPL
alias:          fs-exfat
suserelease:    SLE15-SP3
srcversion:     2B748BF6C602439615243B0
depends:        
supported:      yes
retpoline:      Y
intree:         Y
name:           exfat
vermagic:       5.3.18-150300.59.76-default SMP mod_unload modversions 
sig_id:         PKCS#7
signer:         SUSE Linux Enterprise Secure Boot CA
sig_key:        ED:87:85:B7:8F:FC:12:7F
sig_hashalgo:   sha256
signature:      18:BF:61:29:B0:D0:29:07:3A:7A:83:93:7E:51:03:C0:A8:13:02:FC:
                70:63:E9:17:73:C0:62:AD:07:27:5E:83:92:A0:75:C3:E6:05:89:B7:
                BD:3D:E1:8B:3F:3C:04:80:68:EB:2F:CF:13:C8:62:5A:0F:DD:29:77:
                53:B5:36:C1:20:90:A6:5F:04:0C:09:D2:F4:5C:BF:41:D9:C4:B4:B9:
                FE:3E:E6:2B:B5:78:53:27:44:D9:0C:08:CB:CF:FE:9E:AB:B8:01:D8:
                59:A4:D1:79:9A:94:88:2C:43:2E:14:50:2C:04:A5:EE:84:7A:78:28:
                FD:22:46:39:05:20:9C:67:28:FA:59:7D:CA:F1:19:48:7B:7F:04:34:
                0B:CD:33:04:51:3D:EA:55:55:45:CD:73:F7:08:23:27:49:62:E1:E2:
                2F:D2:40:52:1F:F6:45:0E:34:12:7E:50:18:1B:30:5C:07:C6:86:DB:
                1B:D7:66:5C:53:47:77:2E:49:FC:F1:26:00:E6:F7:EB:44:AA:57:36:
                DD:88:A0:B7:09:7F:E2:3F:FB:59:78:95:79:B3:4D:AC:BE:3F:4F:8B:
                86:2E:1F:B0:19:CF:52:53:AD:94:D4:70:28:1C:CC:BE:FE:28:56:C9:
                28:83:88:8E:0F:AB:D1:A7:B5:E0:FB:EC:8C:8B:33:1B
 # 


 > rpm --query --whatprovides /lib/modules/5.3.18-150300.59.76-default/kernel/fs/exfat/exfat.ko.xz
kernel-default-5.3.18-150300.59.76.1.x86_64
 > 

Please check the files provided by your version of the default Kernel package.
[HR][/HR]BTW: You can also install the “exfatprogs” package from the main openSUSE repository.

And, before anyone says “But, only Read-Only is supported” –


 > pwd
/run/media/xxx/SD QUATTRO
 > ls
DCIM  MISC  System Volume Information  Textdatei.txt
 > l
insgesamt 640
drwxr-xr-x  5 xxx  users 131072  5. Jul 12:19 ./
drwxr-x---+ 3 root root      60  5. Jul 12:13 ../
drwxr-xr-x  3 xxx  users 131072 16. Jun 2017  DCIM/
drwxr-xr-x  2 xxx  users 131072 16. Jun 2017  MISC/
drwxr-xr-x  2 xxx  users 131072 16. Jun 2017  System Volume Information/
-rwxr-xr-x  1 xxx  users      2  5. Jul 12:19 Textdatei.txt*
 > touch aaaa
 > l
insgesamt 640
drwxr-xr-x  5 xxx  users 131072  5. Jul 12:20 ./
drwxr-x---+ 3 root root      60  5. Jul 12:13 ../
-rwxr-xr-x  1 xxx  users      0  5. Jul 12:20 aaaa*
drwxr-xr-x  3 xxx  users 131072 16. Jun 2017  DCIM/
drwxr-xr-x  2 xxx  users 131072 16. Jun 2017  MISC/
drwxr-xr-x  2 xxx  users 131072 16. Jun 2017  System Volume Information/
-rwxr-xr-x  1 xxx  users      2  5. Jul 12:19 Textdatei.txt*
 > rm aaaa Textdatei.txt
 > l
insgesamt 512
drwxr-xr-x  5 xxx  users 131072  5. Jul 12:20 ./
drwxr-x---+ 3 root root      60  5. Jul 12:13 ../
drwxr-xr-x  3 xxx  users 131072 16. Jun 2017  DCIM/
drwxr-xr-x  2 xxx  users 131072 16. Jun 2017  MISC/
drwxr-xr-x  2 xxx  users 131072 16. Jun 2017  System Volume Information/
 > 

[HR][/HR]BTW: The digital camera model and manufacturer which formatted the SDXC card is obvious … >:)

I bet is is read only because windows marked it as “in use”.
Shutdown in windows does not really shutdown - it hibernates.

If you want to use it - try reboot in windows which will mark things as “closed”

Did you successfully eject it from windows?.

Or, the friends in Redmond had set the “ReadOnly” flag –


 > udisksctl info --block-device /dev/sdf
/org/freedesktop/UDisks2/block_devices/sdf:
*  org.freedesktop.UDisks2.Block:
    Configuration:              ]
    CryptoBackingDevice:        '/'
    Device:                     /dev/sdf
    DeviceNumber:               2128
    Drive:                      '/org/freedesktop/UDisks2/drives/Generic__USB3_2e0_CRW_SD_201006010301'
    HintAuto:                   true
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 false
    Id:                         
    IdLabel:                    
    IdType:                     
    IdUUID:                     
    IdUsage:                    
    IdVersion:                  
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/sdf*
    **ReadOnly:                   false**
*    Size:                       63864569856
    Symlinks:                   /dev/disk/by-id/usb-Generic-_USB3.0_CRW-SD_201006010301-0:2
                                /dev/disk/by-path/pci-0000:01:00.0-usb-0:4:1.0-scsi-0:0:0:2
    UserspaceMountOptions:      
  org.freedesktop.UDisks2.PartitionTable:
    Partitions:         '/org/freedesktop/UDisks2/block_devices/sdf1']
    Type:               dos*
 > udisksctl info --block-device /dev/sdf1
/org/freedesktop/UDisks2/block_devices/sdf1:
*  org.freedesktop.UDisks2.Block:
    Configuration:              ]
    CryptoBackingDevice:        '/'
    Device:                     /dev/sdf1
    DeviceNumber:               2129
    Drive:                      '/org/freedesktop/UDisks2/drives/Generic__USB3_2e0_CRW_SD_201006010301'
    HintAuto:                   true
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 false
    Id:                         by-uuid-F01F-DD02
    IdLabel:                    SD QUATTRO
    IdType:                     exfat
    IdUUID:                     F01F-DD02
    IdUsage:                    filesystem
    IdVersion:                  1.0
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/sdf1*
    **ReadOnly:                   false**
*    Size:                       63847792640
    Symlinks:                   /dev/disk/by-id/usb-Generic-_USB3.0_CRW-SD_201006010301-0:2-part1
                                /dev/disk/by-label/SD\x20QUATTRO
                                /dev/disk/by-partuuid/4c6faf3d-01
                                /dev/disk/by-path/pci-0000:01:00.0-usb-0:4:1.0-scsi-0:0:0:2-part1
                                /dev/disk/by-uuid/F01F-DD02
    UserspaceMountOptions:      
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:        
    Size:               0
  org.freedesktop.UDisks2.Partition:
    Flags:              0
    IsContained:        false
    IsContainer:        false
    Name:               
    Number:             1
    Offset:             16777216
    Size:               63847792640
    Table:              '/org/freedesktop/UDisks2/block_devices/sdf'
    Type:               0x07
    UUID:               4c6faf3d-01*
 > 

But, the only way I’ve found to toggle the ReadOnly flag is, to move the physical “Write Protect” switch on the SD Card.

  • Most Card Readers have a simple physical pin which detects the state of the “Write Protect” switch on the SD Cards –
    If that mechanical feature of the Card Reader is faulty then … >:)

Are you using a “microSD Adaptor”?

  • All my SanDisk Adaptors have a physical Write Protect switch which, over time, can become loose and easily moveable – for example when inserting the Adaptor into a Card Reader …

There are rumours that, the fsck tool for exFAT can clear mysterious Read-Only flags which may in fact be “dirty” bits –


 # fsck.exfat --verbose /dev/sdf1
exfatprogs version : 1.0.4
volume label [SD QUATTRO]
sector size:  512.00 B
cluster size: 128.00 KB
volume size:  59.46 GB
/dev/sdf1: clean. directories 6, files 10
 # 

[QUOTE=karlmistelberger;3139385]Run these commands and post all as follows:

**erlangen:~ #** df -h /FR735/ 
Filesystem      Size  Used Avail Use% Mounted on 
/dev/sdc         11M  7.1M  3.1M  70% /FR735 
**erlangen:~ #** fdisk -l /dev/sdc 
**Disk /dev/sdc: 10.08 MiB, 10570752 bytes, 20646 sectors**
Disk model: FR735XT Flash    
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: 0x00000000 
**erlangen:~ #** lsblk -O /dev/sdc 
NAME KNAME PATH MAJ:MIN FSAVAIL FSSIZE FSTYPE FSUSED FSUSE% FSROOTS FSVER MOUNTPOINT MOUNTPOINTS LABEL UUID PTUUID PTTYPE PARTTYPE PARTTYPENAME PARTLABEL PARTUUID PARTFLAGS  RA RO RM HOTPLUG MODEL SERIAL  SIZE STATE OWNER GROUP MODE      
 ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED RQ-SIZE TYPE DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO WSAME WWN RAND PKNAME HCTL       TRAN SUBSYSTEMS  REV VENDOR ZONED DAX 
sdc  sdc   /dev/sdc 
                  8:32       3M    10M vfat       7M    70% /       FAT16 /FR735     /FR735      FR735                                                                       512  0  1       1 FR735 Garmin 10.1M runni root  disk  brw-rw----
         0    512      0     512     512    1 bfq         2 disk        0        0B       0B         0    0B        1        6:0:0:0    usb  block:scsi:usb:pci 
                                                                                                                                                                                                                                              
                                                                                                                                                        1.00 Garmin none    0 
**erlangen:~ #**
# fdisk -l /dev/sdb: 116,5 GiB, 125096165376 bytes, 244328448 sectors
Disk model: USB SD Reader   
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: 0x5bed2f5a


Device     Boot     Start       End   Sectors   Size Id Type
/dev/sdb1  *         2048    104447    102400    50M  7 HPFS/NTFS/exFAT
/dev/sdb2          104448 249041623 248937176 118,7G  7 HPFS/NTFS/exFAT
/dev/sdb3       249042944 250064895   1021952   499M 27 Hidden NTFS WinRE



# lsblk -O /dev/sdb
NAME KNAME PATH MAJ:MIN FSAVAIL FSSIZE FSTYPE FSUSED FSUSE% FSROOTS FSVER MOUNTPOINT MOUNTPOINTS LABEL UUID                                 PTUUID                               PTTYPE PARTTYPE PARTTYPENAME PARTLABEL PARTUUID                             PARTFLAGS  RA RO RM HOTPLUG MODEL SERIAL   SIZE STATE OWNER GROUP MODE       ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED RQ-SIZE TYPE DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO WSAME WWN RAND PKNAME HCTL       TRAN SUBSYSTEMS  REV VENDOR ZONED DAX
sdb  sdb   /dev/sdb
│                 8:16                                                                                                                      5bed2f5a                             dos                                                                                   512  1  1       1 USB S 058F31 116,5G runni root  disk  brw-rw----         0    512      0     512     512    1 bfq         2 disk        0        0B       0B         0    0B        1        8:0:0:0    usb  block:scsi:usb:pci
│                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                1.00 Generi none    0
├─sdb1
│    sdb1  /dev/sdb1
│                 8:17                 ntfs                                                      System Reserved
│                                                                                                      86622AF7622AEC1D                     5bed2f5a                             dos    0x7      HPFS/NTFS/exFAT
│                                                                                                                                                                                                                       5bed2f5a-01                          0x80      512  1  1       1                 50M       root  disk  brw-rw----         0    512      0     512     512    1 bfq         2 part        0        0B       0B         0    0B        1 sdb                    block:scsi:usb:pci
│                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            none    0
└─sdb2
     sdb2  /dev/sdb2
                  8:18                 ntfs                                                            60E82BC0E82B9378                     5bed2f5a                             dos                                                                                   512  1  1       1              116,5G       root  disk  brw-rw----         0    512      0     512     512    1 bfq         2 part        0        0B       0B         0    0B        1 sdb                    block:scsi:usb:pci
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             none    0

df -h /FR735/ won’t work since the drive does not mount, and I don’t have that directory. But I did try to mount it to /mnt, and …

# mount /dev/sdb /mnt
FUSE exfat 1.3.0
WARN: '/dev/sdb' is write-protected, mounting read-only.
ERROR: exFAT file system is not found.

Yes I am and I tried it in both positions. Brand new microSD and adaptor.

# fsck.exfat --verbose /dev/sdb1
exfatprogs version : 1.1.3
failed to find exfat file system
boot region is corrupted. try to restore the region from backup. Fix (y/N)? n
ion-office:/home/ion # 

It automatically responded “n”.

In this convoluted epic of personal stupidity I have managed to destroy a properly licensed copy of Windows 10 and to have bought an expensive microSD card that I can’t use. I have learned something. My brain is no match for the multitude of system programmers at Microsoft. But on the plus side, I hardly ever use Windows and I now have a decent Fujitsu second hand notebook that runs 15.4.

Thanks to all for your help, and when I calm down I might try some more experimentation.

Random write actions are never a good idea. Prepare a Windows 10 iso and try to fix the install: https://forums.opensuse.org/showthread.php/546634-How-to-Install-Windows-10-for-Free-Update Enter your product key if available.

Search for linux readonly ntfs - Google Suche

Thanks for your suggestions.

After I had cooled down a bit I booted the SD in question which was somewhat smaller than my original Win10 install size. I didn’t think it would boot properly being several GB’s smaller. But it did boot and after several updates and reboots, it runs. I have just backed it up to an old IDE drive via USB which took forever and will not be using it soon. I decided that since I hardly ever use Windows and it’s a small notebook SSD I would just have 15.4 Leap installed. While I am reasonably sure that Leap co-exists with Windows, I am never sure what tricks Microsoft will engage in killing all OS competition.