分页: 1 / 1

u盘如何解除只读权限?

发表于 : 2017-05-25 19:46
谢宝良
http://blog.sina.com.cn/s/blog_4b5f85df0102v38b.html

得一u盘,却被分成两区,一个区设置成广告内容。无法写入任何东西。

Re: u盘如何解除只读权限?

发表于 : 2017-05-26 8:03
poloshiao
u盘,却被分成两区,一个区设置成广告内容。无法写入任何东西。
1. 請提供品牌與詳細型號
1-1. 意思是 能否寫入 可能須視該品牌與型號的韌體 firmware 而定

2. 把下面指令 複製 貼進終端機 執行
2-1. sudo parted -l print
看看 u 盤的裝置 代號 例如 /dev/sdx
2-1-1. sudo parted /dev/sdx print # x 請代換成正確的代號
把 2-1-1. 結果全部直接 選取/複製/貼上來
却被分成两区
2-2. sudo ls -Al /media
找出 u 盤的掛載預設目錄 例如 yyyyyyyy 及 zzzzzzzz
2-2-1. sudo ls -Al /media/yyyyyyyy
把 2-2-1. 結果全部直接 選取/複製/貼上來
2-2-2. sudo ls -Al /media/zzzzzzzz
把 2-2-2. 結果全部直接 選取/複製/貼上來
2-3. 不要摘錄 以免遺漏重要資訊

Re: u盘如何解除只读权限?

发表于 : 2017-05-26 11:45
谢宝良

代码: 全选

xiebaoliang xiebaoliang # sudo parted -l print
Model: ATA WDC WD3200AAJS-0 (scsi)
Disk /dev/sda: 320GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system     Flags
 1      32.3kB  206MB   206MB   primary   ext4            boot
 2      207MB   22.2GB  22.0GB  primary   ext4
 4      22.2GB  320GB   298GB   extended
 6      22.2GB  24.2GB  1999MB  logical   linux-swap(v1)
 7      24.2GB  201GB   176GB   logical   ext4
 5      201GB   320GB   119GB   logical   ext4


Model: General UDisk (scsi)
Disk /dev/sdb: 4027MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system  Flags
 1      0.00B  4027MB  4027MB  fat32


Warning: Unable to open /dev/sdc read-write (Read-only file system).  /dev/sdc
has been opened read-only.
Model: General UDisk (scsi)
Disk /dev/sdc: 4152MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system  Flags
 1      0.00B  4152MB  4152MB  fat32

代码: 全选

sudo ls -Al /media
total 8
drwxr-x---+ 2 root root 4096 10月 14  2016 root
drwxr-x---+ 4 root root 4096  5月 26 11:38 xiebaoliang

代码: 全选

xiebaoliang xiebaoliang # sudo ls -Al /dev/sdc
brw-rw---- 1 root disk 8, 32  5月 26 11:38 /dev/sdc

Re: u盘如何解除只读权限?

发表于 : 2017-05-26 12:20
vickycq
谢宝良 写了:Warning: Unable to open /dev/sdc read-write (Read-only file system).
/dev/sdc has been opened read-only.
如果这个方法不起作用那很可能是“硬件”写保护了,即在主控层面加了写保护。

代码: 全选

sudo hdparm -r0 /dev/sdc
先卸载,再执行这个命令。完事后再加参数 -o remount,rw 参数挂载 /dev/sdc1

Re: u盘如何解除只读权限?

发表于 : 2017-05-26 13:13
谢宝良

代码: 全选

xiebaoliang@xiebaoliang ~ $ sudo mount  -o remount,rw   /dev/sdc
mount: cannot remount block device /dev/sdc read-write, is write-protected

Re: u盘如何解除只读权限?

发表于 : 2017-05-26 18:05
poloshiao
u盘,却被分成两区,一个区设置成广告内容。无法写入任何东西。
sudo ls -Al /media
drwxr-x---+ 2 root root 4096 10月 14 2016 root
drwxr-x---+ 4 root root 4096 5月 26 11:38 xiebaoliang
1. 把下面指令 複製 貼進終端機 執行
1-1. sudo ls -Al /media/root
1-2. sudo ls -Al /media/xiebaoliang
1-3. sudo getfacl /media/root
1-4. sudo getfacl /media/xiebaoliang
把結果全部直接 選取/複製/貼上來

Re: u盘如何解除只读权限?

发表于 : 2017-05-26 22:02
谢宝良

代码: 全选

xiebaoliang@xiebaoliang ~ $  sudo ls -Al /media/root
total 0
xiebaoliang@xiebaoliang ~ $  sudo ls -Al /media/xiebaoliang
total 8
drwx------ 4 xiebaoliang xiebaoliang 4096  1月  1  1970 02DE-D261
drwx------ 3 xiebaoliang xiebaoliang 4096  1月  1  1970 CAAE-6400
xiebaoliang@xiebaoliang ~ $ sudo getfacl /media/root
getfacl: Removing leading '/' from absolute path names
# file: media/root
# owner: root
# group: root
user::rwx
user:root:r-x
group::---
mask::r-x
other::---

xiebaoliang@xiebaoliang ~ $ sudo getfacl /media/xiebaoliang
getfacl: Removing leading '/' from absolute path names
# file: media/xiebaoliang
# owner: root
# group: root
user::rwx
user:xiebaoliang:r-x
group::---
mask::r-x
other::---



Re: u盘如何解除只读权限?

发表于 : 2017-05-26 22:05
谢宝良
白送的u盘,一大堆。每个都有部分空间被广告占用。

Re: u盘如何解除只读权限?

发表于 : 2017-05-26 22:16
onlylove
找个windows机器,然后再找个芯片精灵,识别下主控,然后找对应的量产工具量产,简单粗暴

Re: u盘如何解除只读权限?

发表于 : 2017-05-27 9:48
poloshiao
sudo ls -Al /media
drwxr-x---+ 2 root root 4096 10月 14 2016 root
drwxr-x---+ 4 root root 4096 5月 26 11:38 xiebaoliang
0. 注意 這個特殊符號 +
表示 這個目錄 可能存在 acl 控制機制
0-1. 參閱 acl wiki
0-1-1. https://zh.wikipedia.org/wiki/%E5%AD%98 ... 2%E5%88%97
0-1-2. https://en.wikipedia.org/wiki/Access_control_list
sudo getfacl /media/root
getfacl: Removing leading '/' from absolute path names
# file: media/root
# owner: root
# group: root
user::rwx
user:root:r-x
group::---
mask::r-x
other::---
sudo getfacl /media/xiebaoliang
getfacl: Removing leading '/' from absolute path names
# file: media/xiebaoliang
# owner: root
# group: root
user::rwx
user:xiebaoliang:r-x
group::---
mask::r-x
other::---
1. 先參閱
https://help.ubuntu.com/community/FilePermissionsACLs
FilePermissionsACLs
POSIX Access Control Lists (ACLs) are more fine-grained access rights for files and directories. An ACL consists of entries specifying access permissions on an associated object. ACLs can be configured per user, per group or via the effective rights mask.
These permissions apply to an individual user or a group, and use the same as rwx found in regular permissions.
1-1. acl 機制 是比較細密的權限機制

2. https://portal.tacc.utexas.edu/tutorials/acls
The two important command-line tools for managing ACLs are "setfacl" and "getfacl"
2-1. http://manpages.ubuntu.com/manpages/xen ... acl.5.html
2-2. http://manpages.ubuntu.com/manpages/xen ... acl.1.html
2-3. http://manpages.ubuntu.com/manpages/xen ... acl.1.html

3. http://xmodulo.com/configure-access-con ... linux.html
How to configure Access Control Lists (ACLs) on Linux

Re: u盘如何解除只读权限?

发表于 : 2017-05-27 10:38
poloshiao
u盘,一大堆。每个都有部分空间被广告占用。
看看 U 盤 有沒有內附使用說明書 上面有沒有說明

如果沒有使用說明書 請提供 U 盤品牌及詳細型號

如果不知道 U 盤品牌及詳細型號
lsusb
把結果全部複製貼上來

Re: u盘如何解除只读权限?

发表于 : 2017-05-27 14:09
谢宝良

代码: 全选

xiebaoliang@xiebaoliang ~ $ lsusb
Bus 001 Device 004: ID 048d:1234 Integrated Technology Express, Inc. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 1a81:1004 Holtek Semiconductor, Inc. 
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

都说是白送的东西,肯定不是大厂的产品了。

Re: u盘如何解除只读权限?

发表于 : 2017-05-27 20:32
poloshiao
lsusb
Bus 001 Device 004: ID 048d:1234 Integrated Technology Express, Inc.
http://www.linux-usb.org/usb.ids
1. U 盤廠家
048d Integrated Technology Express, Inc.
1234 還沒有登錄 這個產品號

1-1. http://data.upan.cc/show/048D_1234_5.00_23338.html
设备ID : VID = 048D PID = 1234
设备版本 : 5.00
设备型号 : UDISK
芯片制造商 : Chipsbank
芯片型号 : CBMENERAL
工具下载 : http://www.upan.cc/tools/mass/UMPTool/
: http://ap.upan.cc/plus/search.php?keywo ... 2&kwtype=1

1-2. http://www.upan.cc/tools/security/
安全工具

1-3. http://www.upan.cc/tools/others/
其他工具

1-4. 建議 直接向 芯片制造商 : Chipsbank 客服諮詢