Ask your own question, for FREE!
Computer Science 9 Online
OpenStudy (anonymous):

something went wrong after I typed the following command: cat bighonkingfile > sdX and now my 2GB USB flash stick only has about 640 MB of logical memory... how do I get the 1.36 GB of memory back?

OpenStudy (jagatuba):

A) what exactly were you doing? B) have you tried reformatting?

OpenStudy (anonymous):

I tried reformatting but it only ends up with ~640MB total :(

OpenStudy (anonymous):

You'll have to repartition the drive, as cat'ing the file directly to the device has overwritten the partition header. Use fdisk to recreate the partition and then makefs.extN to recreate the file system (or the requisite GUI tools if you don't want to mess with fdisk's command line syntax). That should fix it.

OpenStudy (jagatuba):

I mean from looking at your command you were trying to send the directory contents to your drive. If that directory was literally a "big honking file" then that is your problem right there. But my bash vocab is a little rusty so if I'm off on this please correct me.

OpenStudy (jagatuba):

Oh yes. Nice opie!

OpenStudy (anonymous):

thanks. I'm off to google on what arguments i should pass to fdisk

OpenStudy (anonymous):

how do I prevent stuff like this from happening in the future? :(

OpenStudy (jagatuba):

Don't use commands unless you thoroughly understand what they do? lol ;)

OpenStudy (jagatuba):

Of course what fun is that?

OpenStudy (anonymous):

but the only way I'll learn how to properly use those commands would be to try them! :-D maybe I should get a virtual machine to play with instead... I don't want to fry my mobo or something :(

OpenStudy (jagatuba):

I don't think there is a cygwin command to do that. :)

OpenStudy (jagatuba):

Nah really, 90% of the stuff you do can be reversed as opie so masterfully pointed out, but do be careful with disk commands those can screw your system.

OpenStudy (anonymous):

That's the whole point of user privilege escalation. Whenever anything requires super user privileges (such as writing directly to a block device), you should verify doubly that this is really what you want to do. sudo translates from *nix to english directly to 'read this twice and make sure you completely understand what it's doing' ;)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!