[SOLVED] unable to mount a usb flash drive and an SD card after changing mount directory name
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
Not sure what to do from there, or if this option will work. It seems like it only found a single partition of 3MB, and a few more partitions of 0MB?? It's an 8GB usb drive.
Others may be able to advise further regarding the use of gpart to try to recover the partition. I have my doubts about this, but so long as you have made your backup image, you have nothing to lose I guess. Instead, I would try using foremost to attempt file recovery. The wiki suggests doing this from the backup image itself. It's only using read operations, so there should be no risk with this approach.
I just tried Gparted and the result was similar to gpart. It found 1 3MB NTFS partition and 1 0MB NTFS partition. So it looks like the filesystem was/is NTFS, but I don't know what's up with the weird 3MB size. I'll try foremost next and report back.
I just tried Gparted and the result was similar to gpart. It found 1 3MB NTFS partition and 1 0MB NTFS partition. So it looks like the filesystem was/is NTFS, but I don't know what's up with the weird 3MB size. I'll try foremost next and report back.
If you have everything backed up, I would suggest just deleting all of the partitions and creating a new NTFS one.
However, make sure that you're using the right disk! Double- and triple-check that sdb corresponds to the USB disk that you just inserted, and not some other disk (Does your printer have an SD-card reader? Do you have your phone plugged in? Is your mp3 player connected?). I would highly recommend completely disconnecting anything and everything that could potentially be some form of drive before proceeding. And then make sure that you're using the USB disk and not your internal hard drive.
I know that it can seem like a lot just to format a flash drive, but you'd be surprised. I've done something like this before, when I was adding a hard drive to my desktop. Fortunately, I keep pretty good backups, but it's a lot easier to seriously screw up than you think it is.
If you can't recover the file system, all hope is not lost. You can work with the device or backup you created to try to recover the files using a utility like foremost.
Thanks for the help everybody, I was able to recover the files with photorec. Even though that program does recover different file types, I can see why it's called photorec. The files on my drive were mostly music files located in album directories. Although I got the files back, there are no file names and all the directories are lost, so I have a ton of .flac files all jumbled into a single directory with no artist/title info. The metadata is still there though, because when I play them all the info turns up on the player. I'll have to see if I can find a quick way to get them all re-organized.
Anyway, very glad to be able to recover the data, thanks again!
The files on my drive were mostly music files located in album directories. Although I got the files back, there are no file names and all the directories are lost, so I have a ton of .flac files all jumbled into a single directory with no artist/title info.
This is expected behavior, since file carving tools like Photorec ignore filesystem information (which stores filenames) and purely extract the files they can find.
Quote:
The metadata is still there though, because when I play them all the info turns up on the player. I'll have to see if I can find a quick way to get them all re-organized.
I am sure that there are specialized tools for that, but you could also write a script to do this. Metadata from FLAC files can easily be extracted using the metaflac tool, which comes in the flac package that most distributions should have in their repositories. For example:
Code:
metaflac --export-tags-to=- $FILENAME
will show you all tags in the metadata. Single tags, like ARTIST or TITLE can be extracted with the --show-tag option, for example
Code:
metaflac --show-tag TITLE $FILENAME
will show you the title of the track. It shouldn't be hard to use that information to write a script that generates meaningful filenames to be used to rename the files.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.