Changing partitions r/w access on a usb

Technical issues/questions of an intermediate or advanced nature.
Post Reply
User avatar
francois
Contributor
Contributor
Posts: 5649
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Changing partitions r/w access on a usb

Post#1 by francois » 10 Apr 2019, 16:02

I got I do not know why into the impossibility to write on my usb partitions. Is there any trick with fdisk or any other software to get it to be read/write by root. And also by any user. I want to keep the actual data.

Thanks.
Prendre son temps, profiter de celui qui passe.

User avatar
Ed_P
Contributor
Contributor
Posts: 5032
Joined: 06 Feb 2013, 22:12
Distribution: 4.0 Cinnamon 64-bit ISO
Location: Western NY, USA

Changing partitions r/w access on a usb

Post#2 by Ed_P » 10 Apr 2019, 18:36

The answer I usually see is Return it to the seller for a replacement. If the seller won't take it back return it to the manufacturer. If the files on the drive are confidential some manufacturers also allow you to destroy it with a hammer before returning it.
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 6094
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil
Contact:

Changing partitions r/w access on a usb

Post#3 by brokenman » 13 Apr 2019, 19:55

Did you by chance dd an image to it?
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
francois
Contributor
Contributor
Posts: 5649
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Changing partitions r/w access on a usb

Post#4 by francois » 14 Apr 2019, 01:43

This is the usb key that I built based on that post, it includes three partitions and boots porteus with syslinux (the porteus install)
SOLVED: linux usb key recognized in window 10

Code: Select all

root@porteus:/mnt# BLKID

...
/dev/sdc1: UUID="86F3-9F22" TYPE="vfat" PARTUUID="5bc85df4-01"
/dev/sdc2: UUID="34103e53-f26a-4d02-8a9a-c6cb0915ab53" TYPE="ext2" PARTUUID="5bc85df4-02"
/dev/sdc3: UUID="97ef3e19-0c8a-4d56-9810-5a00bf6c5c95" TYPE="ext2" PARTUUID="5bc85df4-03"
/dev/sdc4: UUID="6480ccf9-485d-41d3-84e9-74f47c800ad4" TYPE="swap" PARTUUID="5bc85df4-04"

Code: Select all

root@porteus:/mnt# tree -L 2
...
├── sdc1
│   ├── EFI
│   ├── System Volume Information
│   ├── boot
│   └── desk_bkp_win
├── sdc2
│   ├── 180806changes.xzm
│   ├── 1_nemesis
│   ├── 64bit_v31
│   ├── affaires
│   ├── bureau
│   ├── desktop_bak
│   ├── isos
│   └── lost+found
├── sdc3
│   └── lost+found
└── sdc4

Code: Select all

root@porteus:~# mount /dev/sdc2 /mnt/sdc2
mount: /mnt/sdc2: WARNING: device write-protected, mounted read-only.
root@porteus:~# file -s /dev/sdc
/dev/sdc: DOS/MBR boot sector; partition 1 : ID=0xb, active, start-CHS (0x0,32,33), end-CHS (0x20,219,27), startsector 2048, 8237056 sectors; partition 2 : ID=0x83, start-CHS (0x20,219,28), end-CHS (0x3ff,254,63), startsector 8239104, 32233472 sectors; partition 3 : ID=0x83, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 40472576, 17440768 sectors; partition 4 : ID=0x82, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 57913344, 2652160 sectors
root@porteus:~# umount /dev/sdc2 /mnt/sdc2
umount: /mnt/sdc2: not mounted.
root@porteus:~# 
Prendre son temps, profiter de celui qui passe.

User avatar
francois
Contributor
Contributor
Posts: 5649
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Changing partitions r/w access on a usb

Post#5 by francois » 14 Apr 2019, 13:56

https://unix.stackexchange.com/question ... read-write

Code: Select all

root@porteus:~# e2fsck -n /dev/sdc
e2fsck 1.44.1 (24-Mar-2018)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/sdc

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

/dev/sdc contains `DOS/MBR boot sector; partition 1 : ID=0xb, active, start-CHS (0x0,32,33), end-CHS (0x20,219,27), startsector 2048, 8237056 sectors; partition 2 : ID=0x83, start-CHS (0x20,219,28), end-CHS (0x3ff,254,63), startsector 8239104, 32233472 sectors; partition 3 : ID=0x83, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 40472576, 17440768 sectors; partition 4 : ID=0x82, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 57913344, 2652160 sectors' data
root@porteus:~# e2fsck -b 8193 /dev/sdc
e2fsck 1.44.1 (24-Mar-2018)
e2fsck: Read-only file system while trying to open /dev/sdc
Disk write-protected; use the -n option to do a read-only
check of the device.
root@porteus:~# e2fsck -b 32768 /dev/sdc
e2fsck 1.44.1 (24-Mar-2018)
e2fsck: Read-only file system while trying to open /dev/sdc
Disk write-protected; use the -n option to do a read-only
check of the device.
root@porteus:~# e2fsck -n -b 8193 /dev/sdc
e2fsck 1.44.1 (24-Mar-2018)
e2fsck: Bad magic number in super-block while trying to open /dev/sdc

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

/dev/sdc contains `DOS/MBR boot sector; partition 1 : ID=0xb, active, start-CHS (0x0,32,33), end-CHS (0x20,219,27), startsector 2048, 8237056 sectors; partition 2 : ID=0x83, start-CHS (0x20,219,28), end-CHS (0x3ff,254,63), startsector 8239104, 32233472 sectors; partition 3 : ID=0x83, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 40472576, 17440768 sectors; partition 4 : ID=0x82, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 57913344, 2652160 sectors' data
root@porteus:~# e2fsck -n -b 32768 /dev/sdc
e2fsck 1.44.1 (24-Mar-2018)
e2fsck: Bad magic number in super-block while trying to open /dev/sdc

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

/dev/sdc contains `DOS/MBR boot sector; partition 1 : ID=0xb, active, start-CHS (0x0,32,33), end-CHS (0x20,219,27), startsector 2048, 8237056 sectors; partition 2 : ID=0x83, start-CHS (0x20,219,28), end-CHS (0x3ff,254,63), startsector 8239104, 32233472 sectors; partition 3 : ID=0x83, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 40472576, 17440768 sectors; partition 4 : ID=0x82, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 57913344, 2652160 sectors' data
root@porteus:~# 
Prendre son temps, profiter de celui qui passe.

User avatar
francois
Contributor
Contributor
Posts: 5649
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Changing partitions r/w access on a usb

Post#6 by francois » 14 Apr 2019, 13:57

Maybe the only thing to do is to backup the data and then reformat the partitions.
What do you think?
Prendre son temps, profiter de celui qui passe.

beny
Full of knowledge
Full of knowledge
Posts: 782
Joined: 02 Jan 2011, 11:33
Location: italy

Changing partitions r/w access on a usb

Post#7 by beny » 14 Apr 2019, 16:04

hi francois the read only system isn't a good thing, try to check the file system via gparted, usb do not have switch like sd card,after the gparted check, try to backup data.

User avatar
francois
Contributor
Contributor
Posts: 5649
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Changing partitions r/w access on a usb

Post#8 by francois » 14 Apr 2019, 20:02

Hello beny. It was not there in the begining and as a root user it is frankly not my style. I think it became read-only because of corrupt files from the output that I provided above.
Santé!
Prendre son temps, profiter de celui qui passe.

Post Reply