Jump to content

USB stick just gone wacky [solved]


neddie
 Share

Recommended Posts

Weirdness afoot on my USB stick - I was transferring some files across between Mandriva and XP, and then for some reason both machines refused to read that directory. I'm not sure if the contents table has got messed up somehow. (I was very careful to unmount it each time before removing). So I tried deleting everything on the stick, and everything was deleted except this rogue directory - neither OS can delete it. And now I can't write to the stick at all, they either say it's read-only or corrupted.

 

So can I reformat it, and rewrite the contents? I tried the obvious (right-click on desktop icon, right-click on Konqueror icon, the 'hardware' section of MCC) and even tried a man -k format, but I'm still lost - is there an easy way to wipe this thing and start afresh?

Link to comment
Share on other sites

I had that happen to me with a Lexar Jump Drive Secure. It began refusing to have any data written to it, in either Linux or Windows. Nothing would work, and couldn't reformat it or fdisk it either.

 

I found out through various postings that this was a known bug in certain Lexar USB drives. I contacted Lexar support via email and they gave me an RMA Number for a replacement drive.

Link to comment
Share on other sites

Hmmm, well this probably isn't the same bug cos this is an Iomega MicroMini. I'm kinda hoping this isn't an irreparable hardware problem, and more of a format-and-everything's-ok-again problem :unsure:

 

Where would I find the format option in Mandriva? I'm kinda suprised it wasn't on the right-click of the desktop icon. And fdisk says it's a partition table manager?

Link to comment
Share on other sites

You can go through Mandriva Control Center, I believe under Hardware (or maybe System) there should be an option to Manage Disks or something of that nature (not at my system, and my memory sucks :P). You can do it through there.

 

Also, from the command line you can use mkdosfs - which I believe is installed by default in Mandriva. Here is some information about it. Most likely you'll be doing something like:

mkdosfs -c /dev/sda1

The -c is to it to check for bad blocks before formatting. This is useful in case a bad block is what is causing your trouble. The /dev/sda1 is the device - this may be different, such as /dev/sda2. Check what your device is before running this command.

Link to comment
Share on other sites

[expletive], you're good :)

 

I'd looked around MCC but that only gave me partition information (DiskDrake) and nothing about formatting (that I could see, anyway). And then I found mkfs, so I tried "mkfs -t vfat /mnt/removable" but it just said "mkfs.vfat: unable to open /mnt/removable/" - grrrr. Maybe that would have worked with the device name but the man says it works with either device name or mount point.

 

So I tried your command (yes, it is sda1), and it said "mkdosfs: /dev/sda1 contains a mounted file system." - well of course it does. So I umounted it and it worked a treat! The wonky directory is gone and I can now write to it again! :thumbs: :D

 

You da man, tyme!

Link to comment
Share on other sites

You da man, tyme!

Indeed, he is. He's definitely an All-Pro and a shoo-in as an MVP candidate. Unfortunately, I don't think he got that much of a signing bonus when he was drafted by MUB right out of college. He's kinda young yet in his career to be talking Hall of Fame, but give him tyme! :D

Link to comment
Share on other sites

  • 2 weeks later...

Update: bit of synchronicity here - according to my website stats, someone recently did a search for "format thumb drive with mandriva" and came up with my page! Which is kinda odd because at the time there was nothing on that page about formatting thumb drives, I'd never had to do it, and certainly had no clue how to do it! I tried googling it and I come up as first hit :D Must be a full moon or something influencing everyone's thumb drives at the moment!

 

So anyway I put your command in there in case someone else has the same problem.

Link to comment
Share on other sites

FYI you are suppose to unmount a partition before formatting it; that's probably why you got the error with mkfs. Also, mcc's diskdrake will not show the format option while the partition is mounted. If you unmount the partition you want to format, the format option will appear.

Link to comment
Share on other sites

Wow, that's pretty much exactly the opposite from what I would expect - thanks for the tip!

Sounds like a great way to hide the formatting tools from the user, especially when the drive is auto-mounted. And that means only someone with root password can reformat a USB stick, cos they need the root password to get into MCC? Odd.

I can't try this out at the mo, I'll give it a go later.

Link to comment
Share on other sites

OK, you're right, so there are now three ways of doing it, two from the command line and one from mcc. For all three, the drive has to be unmounted, and the user has to have root access.

- tyme's method given above,

mkdosfs -c /dev/sda1

- probably the same command under the covers,

mkfs -t vfat /dev/sda1

- from the MCC,

hardware -> Look at and configure the hardware -> Hard Disk -> sda -> Run config tool -> ok -> sda -> click partition -> Unmount -> Format -> ok

I still think a right-click option on the desktop icon would be a more obvious place for it. And let 'normal' users do it.

Link to comment
Share on other sites

I still think a right-click option on the desktop icon would be a more obvious place for it. And let 'normal' users do it.

 

Well that would be the windows way of doing things. You should realize how horribly insecure this approach has proven to be in practice, even in a single user environment. And in a multiuser environment, this approach would result in complete anarchy.

Link to comment
Share on other sites

I don't agree. We're talking about a removable USB stick. As a normal user I can wipe all the files off the thing, and write whatever I like on it. It's got a VFAT file system, so the files don't belong to anyone anyway. How does it make sense that I can't format it? Does that make it more secure for everybody?

 

Now imagine that it's not my machine I'm using, and I don't have root access. Which is more secure, me as a normal user being able to reformat and fix my memory stick, or me requiring the root password for someone else's system? What do I do if there are no machines I can get the root password for - how do I fix my USB stick so I can carry on using it as before?

 

I'm all for a sensible restriction of privileges, but I'd much rather be able to format my USB stick without having the privilege to wipe the system drives (hallo Arctic!). Forcing users to have the power to do both seems to me more like "the windows way".

Link to comment
Share on other sites

Now imagine that it's not my machine I'm using, and I don't have root access. Which is more secure, me as a normal user being able to reformat and fix my memory stick, or me requiring the root password for someone else's system? What do I do if there are no machines I can get the root password for - how do I fix my USB stick so I can carry on using it as before?

 

Because this just happens all the time. Come on now. It's someone elses box. They will determine what you can and can't do on it, regardless of the fact that its your memory stick. If you want your own rig to run this way, just change the permissions on mkfs to setuid. It's your box afterall; set it up the way that's convenient for you. Most 'nix admins would consider this to be a very insecure practice but if it's just you and your data on there, it's really nobody's business but your own. Heck, you could even run as root all the time and have no such hassles if you want, but I wouldn't recommend that.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...