Thumb Drive Not Detected After Reformatting Fail [SOLVED]
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
OK, I'm missing something here: How can I do these things if the TD and SD are inaccessible/not being detected?
Did you ever try fdisk, lsblk or blkid for accessing, or michaelk's last suggestion? Inaccessible and not detected are not the same thing. When the kernel prints messages about them, it's a result of detection.
Code:
[49379.687129] sd 6:0:0:0: [sdb] tag#0 access beyond end of device
[49379.687141] blk_update_request: I/O error, dev sdb, sector 3994496 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
[49379.687171] sd 6:0:0:0: [sdb] tag#0 access beyond end of device
[49379.687176] blk_update_request: I/O error, dev sdb, sector 3994496 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[49379.687181] Buffer I/O error on dev sdb, logical block 499312, async page read
[49447.032468] sd 6:0:0:0: [sdb] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
These messages indicate detection, just not with any filesystem suitable for mounting or files access.
EDIT: SEE NEW INFO IN FOLLOWING POST BEFORE REPLYING (Leaving this in place to help others who may be searching for same issue]
Quote:
Originally Posted by mrmazda
These messages indicate detection, just not with any filesystem suitable for mounting or files access.
That's what I initially thought- but if I run dmesg without the card inserted, I get the same output which you quoted.
lsblk is definitely showing it though...
No card inserted:
Code:
bob@64-130-165-45:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 27.9G 0 part /
├─sda2 8:2 0 1K 0 part
├─sda5 8:5 0 976M 0 part [SWAP]
└─sda6 8:6 0 902.6G 0 part /home
sr0 11:0 1 1024M 0 rom
Card inserted:
Code:
bob@64-130-165-45:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 27.9G 0 part /
├─sda2 8:2 0 1K 0 part
├─sda5 8:5 0 976M 0 part [SWAP]
└─sda6 8:6 0 902.6G 0 part /home
sdb 8:16 1 14.8G 0 disk
sr0 11:0 1 1024M 0 rom
[/code]
fdisk gives me this message:
Code:
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x4e7fadb4.
So you are correct, it is seeing the card. I pressed "w" to save the new DOS disk label (I have no clue as to what I'm doing, but it seemed logical). Now when I run fdisk it says "No partition is defined yet!".
So I see that progress is being made....and I assume that the next logical step would be to create a partition table- which I'm not sure how to do. I could experiment, but I don't want to break anything, so, if I may burden you for a little more guidance, I think this may get fixed.
Last edited by Sumguy; 12-28-2023 at 01:11 PM.
Reason: Redundency
I ran gparted and created a primary partition of 15xxx MiB. and an ext4 filesystem.
Now the computer detects the SD card and opens the filemanager when the card is inserted, and it shows up!
Now the (hopefully) last remaining problem is that it is showing a folder with an "X" icon on it; "properties" shows that this folder is occupy 5% of available space, and when I try transferring a file to the card, it rejects it.
I could try inserting the card in my camera and seeing if that formats it correctly...but I'm afraid of breaking the camera- plus, I'd like to know how to do this properly both for future use, and so I can do the same to my thumb drive.
You were SO CLOSE! You can create and write out a new partition table from within fdisk.
The man page is free, and might be faster.
We cross-posted.
I didn't see the option to create a partition in the man page ("command "m" "?) only to create a new label. But I did run gparted, and got 'er done! Not sure if I did that right though, as there is still one minor issue, as mentioned in my previous post.
I could try inserting the card in my camera and seeing if that formats it correctly...but I'm afraid of breaking the camera- plus, I'd like to know how to do this properly both for future use, and so I can do the same to my thumb drive.
I'm not aware that any camera is capable of using the EXT4 filesystem. They seem always to use non-Linux native filesystems. I would not put it in the camera without reading its manual first. The camera should be able to create a new partition table and new FAT filesystem that it can use. If you were to change the existing EXT4 to exFAT by changing the table ID, and reformatting, then it might be ready for camera use.
I'm not aware that any camera is capable of using the EXT4 filesystem. They seem always to use non-Linux native filesystems. I would not put it in the camera without reading its manual first. The camera should be able to create a new partition table and new FAT filesystem that it can use. If you were to change the existing EXT4 to exFAT by changing the table ID, and reformatting, then it might be ready for camera use.
Thanks. Exactly! Seconds before your post appeared, I used gparted to format the SD to FAT32 (Great minds think alike, but I managed to do it anyway ).
And the card is WORKING in the computer (and from what you say, should be safe for the camera, I assume?).
I'll just about ready to mark this thread as solved.....
just onm question: Why wasn't the SD card working in the computer when it was formatted sas ext4?
Make that two questions....
...and why is the card showing a capacity of 14.86GB as opposed to 15.xx since it's a 16GB card?
Code:
bob@64-130-165-45:~$ lsblk /dev/sdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 1 14.8G 0 disk
└─sdb1 8:17 1 14.8G 0 part
I chose "primary" partition in Gparted...should I have chosen "logical"? (Hey, I'll take the 14.86...but I'd like to know what I did wrong so that I can understand this better...and maybe even make this 'repair' perfect.)
When you put the card back in the camera I suggest having it format the card. I would guess most modern cameras use exFAT
Ah..so exFAT is different than FAT32? (I'm pretty sure the camera will reformat it to whatever it uses (Searched the web last night, but could not determine what filesystem my Nikon B500 uses...).
I think I've got it!
Somehow I had created 2 partitions on the SD card initially- the smaller one was of an "unknown filesystem". Used Gparted (Thank goodness for GUI tools) to expand the 16.86GB exFAT partition (It's doing it now..hopefully it'll be successful) and it's showing that it will resize it to 15.92GB...which is right what it should be/used to be....so I think this is solved!
Thank you all for your help and patience! I very much appreciate it!
(Yes, MichaelK, you were correct- camera uses exFAT- determined by removing the working card I had in the camera, and putting it in the computer and running fdisk. I'm sure there was probably a more efficient command...but I don't know it off-hand).
why is the card showing a capacity of 14.86GB as opposed to 15.xx since it's a 16GB card?
Because some tools lie. A card advertised as 16GB is 16GB, which is approximately 14.86GiB. GB refers to a number that is a power of 10. GiB refers to a number that is a power of 2. The difference in the vicinity of 1,000 is 1,000 vs 1024. The spread grows as the numbers grow. 1GB=1,000,000 is 10^6. 1GiB=1,048,576 is 2^20. Where you see 14.86GB it probably should show 14.90GiB. https://physics.nist.gov/cuu/Units/binary.html
Because some tools lie. A card advertised as 16GB is 16GB, which is approximately 14.86GiB. GB refers to a number that is a power of 10. GiB refers to a number that is a power of 2. The difference in the vicinity of 1,000 is 1,000 vs 1024. The spread grows as the numbers grow. 1GB=1,000,000 is 10^6. 1GiB=1,048,576 is 2^20. Where you see 14.86GB it probably should show 14.90GiB. https://physics.nist.gov/cuu/Units/binary.html
That makes sense. I'm fairly certain that the card used to show (before it broke) as 15.92GB....but sure enough, now that Gparted has finished with it, it reads 14.92... I may've been mistaken about the 15.92...who knows- I'm just glad it was able to be fixed, and that if there truly is a discrepancy I now know why, thanks to you.
Now to fix my thumb drive! Now thaty I know how to do it...it should take all of two minutes!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.