LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-06-2021, 03:19 AM   #1
erpils72
LQ Newbie
 
Registered: Apr 2021
Location: Philippines
Distribution: Kali linux arm64
Posts: 1

Rep: Reputation: Disabled
Angry kingston usb thumb drive " Problem opening /dev/sdb for reading! Error is 6 "


┌──(kibot㉿kali)-[~]
└─$ sudo fdisk /dev/sdb

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

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x11b3e285.


Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: No such device or address

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or partx(8)

┌──(kibot㉿kali)-[~]
└─$ sudo partprobe -d /dev/sdb

Show nothing..

I tried gdisk--

┌──(kibot㉿kali)-[~]
└─$ sudo gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.8

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

Command (? for help): t
No partitions

Command (? for help): x

Expert command (? for help): v

No problems found. 60437425 free sectors (28.8 GiB) available in 1
segments, the largest of which is 60437425 (28.8 GiB) in size.


Expert command (? for help): p
Disk /dev/sdb: 60437492 sectors, 28.8 GiB
Model: DataTraveler 3.0
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 1957FC8B-5119-41E9-BB56-AB7E10C4BFC4
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 60437458
Partitions will be aligned on 2048-sector boundaries
Total free space is 60437425 sectors (28.8 GiB)

Command (? for help): n
Partition number (1-128, default 1):
First sector (34-60437458, default = 2048) or {+-}size{KMGTP}:
Last sector (2048-60437458, default = 60437458) or {+-}size{KMGTP}: +100M
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: 60437492 sectors, 28.8 GiB
Model: DataTraveler 3.0
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): C53B8A6D-87A9-4DDC-A698-ECA77CAB6E22
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 60437458
Partitions will be aligned on 2048-sector boundaries
Total free space is 60232625 sectors (28.7 GiB)

Number Start (sector) End (sector) Size Code Name
1 2048 206847 100.0 MiB 8300 Linux filesystem

Command (? for help): n
Partition number (2-128, default 2):
First sector (34-60437458, default = 206848) or {+-}size{KMGTP}:
Last sector (206848-60437458, default = 60437458) or {+-}size{KMGTP}: +200M
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: 60437492 sectors, 28.8 GiB
Model: DataTraveler 3.0
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): C53B8A6D-87A9-4DDC-A698-ECA77CAB6E22
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 60437458
Partitions will be aligned on 2048-sector boundaries
Total free space is 59823025 sectors (28.5 GiB)

Number Start (sector) End (sector) Size Code Name
1 2048 206847 100.0 MiB 8300 Linux filesystem
2 206848 616447 200.0 MiB 8300 Linux filesystem

Command (? for help): n
Partition number (3-128, default 3):
First sector (34-60437458, default = 616448) or {+-}size{KMGTP}:
Last sector (616448-60437458, default = 60437458) or {+-}size{KMGTP}: +100M
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): n
Partition number (4-128, default 4):
First sector (34-60437458, default = 821248) or {+-}size{KMGTP}:
Last sector (821248-60437458, default = 60437458) or {+-}size{KMGTP}: +100M
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: 60437492 sectors, 28.8 GiB
Model: DataTraveler 3.0
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): C53B8A6D-87A9-4DDC-A698-ECA77CAB6E22
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 60437458
Partitions will be aligned on 2048-sector boundaries
Total free space is 59413425 sectors (28.3 GiB)

Number Start (sector) End (sector) Size Code Name
1 2048 206847 100.0 MiB 8300 Linux filesystem
2 206848 616447 200.0 MiB 8300 Linux filesystem
3 616448 821247 100.0 MiB 8300 Linux filesystem
4 821248 1026047 100.0 MiB 8300 Linux filesystem

Command (? for help): n
Partition number (5-128, default 5):
First sector (34-60437458, default = 1026048) or {+-}size{KMGTP}:
Last sector (1026048-60437458, default = 60437458) 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: 60437492 sectors, 28.8 GiB
Model: DataTraveler 3.0
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): C53B8A6D-87A9-4DDC-A698-ECA77CAB6E22
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 60437458
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 206847 100.0 MiB 8300 Linux filesystem
2 206848 616447 200.0 MiB 8300 Linux filesystem
3 616448 821247 100.0 MiB 8300 Linux filesystem
4 821248 1026047 100.0 MiB 8300 Linux filesystem
5 1026048 60437458 28.3 GiB 8300 Linux filesystem

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/sdb.
Problem opening /dev/sdb for reading! Error is 6.
The operation has completed successfully.


when i pull out the thumb drive and put back in and run fdisk it shows this....

└─$ sudo fdisk -l


Disk /dev/sda: 74.53 GiB, 80026361856 bytes, 156301488 sectors
Disk model: FUJITSU MHV2080B
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: 0x8e8b7a62

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 154300415 154298368 73.6G 83 Linux
/dev/sda2 154302462 156301311 1998850 976M 5 Extended
/dev/sda5 154302464 156301311 1998848 976M 82 Linux swap / Solaris


Disk /dev/sdb: 28.82 GiB, 30943995904 bytes, 60437492 sectors
Disk model: DataTraveler 3.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Last edited by erpils72; 12-06-2021 at 03:32 AM. Reason: forgot to put the output in ruunning fdisk
 
Old 12-06-2021, 05:43 AM   #2
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, OS/2, others
Posts: 6,523
Blog Entries: 1

Rep: Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239
Quote:
Originally Posted by erpils72 View Post
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or partx(8)

┌──(kibot㉿kali)-[~]
└─$ sudo partprobe -d /dev/sdb

Show nothing..
Like many FOSS commands, there's nothing for it to show on success. On success, the kernel has the table updated, which subsequent partition management commands will be expected to take into account. With USB devices, it's generally best to detach after partition manipulation, then reattach for further use.

If you're really new with Linux and partitioning, it might be better for you to deal with partitions using Gparted or other GUI tool.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying ISO to thumb drive using 'dd' causes thumb drive to be read-only? ahc_fan Linux - General 8 01-15-2019 08:10 AM
[SOLVED] cannot boot from grub USB thumb drive: /dev/sdb not detected... X-LFS-2010 Linux - Newbie 21 05-30-2018 07:20 PM
cannot boot from grub USB thumb drive: /dev/sdb not detected X-LFS-2010 Linux From Scratch 1 05-29-2018 11:22 AM
dd to copy a thumb drive which I am live booted on to another thumb drive DrinkinHomeBrew Linux - Newbie 3 01-26-2015 04:52 PM
Can i dd if=/dev/sdb of=/dev/sdc if hdsize(sdb)>hdsize(sdc) & size(sdb)<hdsize(sdc) ? ununun Linux - Software 6 06-28-2011 11:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration