so I jsut made a typo in linux again.....

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Karot

Member
Jan 15, 2007
95
0
0
Have you tried using a graphical solution? Just pop in Knoppix and you'll have a smaller chance of "choosing" the wrong partition.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
You haven't mounted it or anything right?

Use DD to take a image of the drive, or at least the drive partition.
dd if=/dev/sda1 of=whatever.img

This only works, of course, if you have enough space on another drive or partition to contain that. That way no matter what you do you can't make things worse.

Save that in a safe place. This is critical as failed attempts at recovery will make things worse.

Then mess around with a BartPE and tools, or install Windows on a different drive and experiment with the various disk recovery utilities.

I'd also try to mount it as ntfs and see if that gets you anywere.
mount -t ntfs -o errors=recovery /dev/sda1 /mnt


Also try asking here, you make get lucky
http://forum.ntfs-3g.org/
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: Karot
Have you tried using a graphical solution? Just pop in Knoppix and you'll have a smaller chance of "choosing" the wrong partition.

It's about as easy to f-up using a GUI. A bit easier... All you have to do is click 'yes' and it will do whatever you say, even if it's not what you want. I've screwed up with GUI programs quite a few times.

The _only_ thing that works is you just have to be very carefull. Just have to be.

fdisk -l /dev/sda

is a handy command to list partitions before you much around with them.
 

Goosemaster

Lifer
Apr 10, 2001
48,775
3
81
Originally posted by: drag
You haven't mounted it or anything right?

Use DD to take a image of the drive, or at least the drive partition.
dd if=/dev/sda1 of=whatever.img

This only works, of course, if you have enough space on another drive or partition to contain that. That way no matter what you do you can't make things worse.

Save that in a safe place. This is critical as failed attempts at recovery will make things worse.

Then mess around with a BartPE and tools, or install Windows on a different drive and experiment with the various disk recovery utilities.

I'd also try to mount it as ntfs and see if that gets you anywere.
mount -t ntfs -o errors=recovery /dev/sda1 /mnt


Also try asking here, you make get lucky
http://forum.ntfs-3g.org/

unfortunately I don't have space to make an image on this drive. I could however make on another but it might be futile. The key is that I recently backed up my data so hopefully I'll check and it will all be intact.

I did lose information, but it isn't the end of the world.

I'll think about it for now. Hell, I might even stay in linux,,,
 

Karot

Member
Jan 15, 2007
95
0
0
Originally posted by: drag
Originally posted by: Karot
Have you tried using a graphical solution? Just pop in Knoppix and you'll have a smaller chance of "choosing" the wrong partition.

It's about as easy to f-up using a GUI. A bit easier... All you have to do is click 'yes' and it will do whatever you say, even if it's not what you want. I've screwed up with GUI programs quite a few times.

The _only_ thing that works is you just have to be very carefull. Just have to be.

fdisk -l /dev/sda

is a handy command to list partitions before you much around with them.


I'd say it's more difficult. You actually see the partition that you select, eliminating any typos, whereas with using the shell, you don't get a chance to look at the code and recognize differences in spatial terms because you just aren't able to notice that small of a detail. Have you ever had a small problem in httpd.conf that prevents apache from running? You could spend minutes trolling through hundreds of lines to find one little typo.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: Karot
Originally posted by: drag
Originally posted by: Karot
Have you tried using a graphical solution? Just pop in Knoppix and you'll have a smaller chance of "choosing" the wrong partition.

It's about as easy to f-up using a GUI. A bit easier... All you have to do is click 'yes' and it will do whatever you say, even if it's not what you want. I've screwed up with GUI programs quite a few times.

The _only_ thing that works is you just have to be very carefull. Just have to be.

fdisk -l /dev/sda

is a handy command to list partitions before you much around with them.


I'd say it's more difficult. You actually see the partition that you select, eliminating any typos, whereas with using the shell, you don't get a chance to look at the code and recognize differences in spatial terms because you just aren't able to notice that small of a detail. Have you ever had a small problem in httpd.conf that prevents apache from running? You could spend minutes trolling through hundreds of lines to find one little typo.

No, I don't do much apache stuff. Plus when I do stuff I use a decent text editor so when the error comes up...

sudo /etc/init.d/apache2 restart
Forcing reload of web server (apache2)...apache2: Syntax error on line 637 of /etc/apache2/apache2.conf: </IfModule> without matching <IfModule> section
failed!
I go:
sudo vi /etc/apa<tab><tab>a<tab>/<tab><tab>apac<tab><enter>
then go:
636j
and I found were the error was.

I generally do very ittle scrolling at all when dealing with text files.

But that stuff isn't easy at all.



The reason what I stated was easier because before pressing the enter key you just stop and look and think about it for a few seconds. On one system I have I have 7 disks in it, in a GUI program it would be all confusing lines and this or that.

Plus in addition to a crapload of menus and different tabs and stuff like that I have to figure out when running a GUI application replacement for simple command line stuff.. the GUI applications, in general, have about a 4000% higher chance to get it completely wrong (even when I happen to get it right) and ah heck everything up. Like if go through a menu or dialog and I select 'save' data, but miss 'accept' and hit 'cancel' (which is about 1/16 of a inch worth of movement) then I could end up formatting something. Or just a plain bug in X, or GTK, or the theme, or about the 30 odd other libs whatever program depends on.

If I am partitioning out a fresh drive, then that's one thing and a GUI is nice since I just click through and do wahtever. I don't have to worry about it. click click click click. If it works it works then it saves me some time. If it doesn't it doesn't and I only loose a few minutes. Seriously.. GUI programs are nice for when you need something you do rountinely or do things that are trivial (as in re-doing them won't bork anything up) and are complicated.

Sure 'spatial' stuff makes sense, but it's all through repitition and familarity. Muscle memory and visual recognition. If you only use a GUI program once every 2 or 3 years, then none of that matters and you basicly have to relearn it over anyways.

If I have information I need to protect and keep safe, I prefer to keep things simple and just _go_slow_ and think about things before hitting enter. The simplier this sort of thing is the better off you are since there realy realy is much likely to have things go wrong. Simple programs are just naturally more reliable then complex programs and there are no way around it. Th thing to remember is easure twice, cut once, nothing a GUI does is going to make that better then the command line.

It just helps to illistrate why it's a bad idea, if you are trying out Linux for the first time, to be running dual boot. If all you can do is have one computer, then you don't have a choice. But if yuou have a choice then I would recommend against it unless you already know what your doing. Dual booting is advanced Linux/computer stuff, but installers do a ok job of making it sane so it's a bit deceptively easy to recommend it to people.

Also it illistrates that even when you know what your doing your going to make mistakes and backups are required.
:)