# accessing harddrive while using linux liveCD?



## ryoko (Oct 13, 2007)

Sorry for posting so much in this forum in one day...but my problem isn't resolved quite yet.
I'm using a Knoppix linux disk to be on this computer right now. I went and messed up my harddrive by adding a new partition to it and now it keeps trying to boot the blank partition instead of the one with the OS On it. So, is there a way (there should be?) to access everything on my harddrive? I need to get in there and delete that empty partition so I can boot up normally.


----------



## eb7w5yfe (Oct 13, 2007)

ryoko said:
			
		

> Sorry for posting so much in this forum in one day...but my problem isn't resolved quite yet.
> I'm using a Knoppix linux disk to be on this computer right now. I went and messed up my harddrive by adding a new partition to it and now it keeps trying to boot the blank partition instead of the one with the OS On it. So, is there a way (there should be?) to access everything on my harddrive? I need to get in there and delete that empty partition so I can boot up normally.


You should be able to just open up the file browser and navigate to the hard drive.  The file browser (equivalent of Windows Explorer) should be one of the icons on the bottom of the screen.  Let me see if I have a Knoppix LiveCD around somewhere and I'll boot it up and give more specific instructions.


----------



## eb7w5yfe (Oct 13, 2007)

Ok, at the bottom of the screen, do you see the round blue icon?  If you hover the mouse over it is says "Konqueror Web Browser"?  Start that one.

It should show a page with a few choices on it, one of which is "Storage Media - Disks and removable media".  Click on that one.

Now, I'm not sure what you will see here.  I see two icons, one of which is the Knoppix CD, and the other which says "104G Media" and has a different icon.  The latter one is the hard drive.  Just click on the icon for the hard drive, and you should see all your files.


----------



## ryoko (Oct 13, 2007)

eb7w5yfe said:
			
		

> Ok, at the bottom of the screen, do you see the round blue icon?  If you hover the mouse over it is says "Konqueror Web Browser"?  Start that one.
> 
> It should show a page with a few choices on it, one of which is "Storage Media - Disks and removable media".  Click on that one.
> 
> Now, I'm not sure what you will see here.  I see two icons, one of which is the Knoppix CD, and the other which says "104G Media" and has a different icon.  The latter one is the hard drive.  Just click on the icon for the hard drive, and you should see all your files.



fuck, nothing comes up. its just empty.  and in the status bar it says media:/  
....i think its trying to read from the cd itself and not my computer's harddrive


----------



## eb7w5yfe (Oct 13, 2007)

I just noticed this part:


			
				ryoko said:
			
		

> I need to get in there and delete that empty partition so I can boot up normally.


It is possible to mess around with your partitions from within Linux, but I don't think it will do you any good.  If your computer is trying to boot off of the wrong partition, deleting that partition is not likely to help.  What you have to do is either make that partition valid to boot off of (install Windows on it), or else fix (re-install?) the Windows bootloader so that it looks at the correct partition when starting up.  This will probably have to be done using a Windows install CD.

What you _can_ do from the Linux LiveCD environment is back up all your data, so that you can work on fixing the computer without worrying about losing any data.

Based on your stated situation, my suggestion would be to back up all your data, completely wipe the hard drive, and reinstall Windows XP.  I don't really see any other option if you don't have a Vista CD and are not willing to acquire one.  

It should be possible to get your existing Vista install working, but I don't think it's going to be easy.  I don't know if XP and Vista use the same bootloader, but if they do, you might be able to use an XP install CD to get Vista booting again.  Or you could install a Linux bootloader like Grub or LILO and configure it to boot Windows.  Neither of these options is easy unless you know what you're doing though.  Wiping and reinstalling Windows from scratch would be easier.


----------



## eb7w5yfe (Oct 13, 2007)

ryoko said:
			
		

> fuck, nothing comes up. its just empty.  and in the status bar it says media:/
> ....i think its trying to read from the cd itself and not my computer's harddrive


Hmm, that's odd.  Someone correct me if I'm wrong, but I think that Windows Vista still uses the same NTFS as XP, right?  It should show up (I'm looking at my Win XP installation from Knoppix right now).

It could be that you managed to mess up the partition table somehow.  If the partition table is messed up but the drive hasn't been formatted, the data is still there but it's going to be harder to get it back.


----------



## eb7w5yfe (Oct 13, 2007)

Ok, here's a way to look at your partitions from within Knoppix:


Open up "K Menu"-->"System"-->"QTPartd".  This is a partition manager.  Just be sure to only look; don't make any changes!

On the left it shows you a list of disks.  I see lots of "/dev/cloopX" devices, "/dev/hda", "/dev/sda", "/dev/sdb".  You can ignore the cloop devices.  The /dev/hd devices are IDE drives, and the /dev/sd devices are SCSI or SATA drives.  If this is a newer computer, it probably has an SATA drive, so look for "/dev/sda".

If you click on the drive, it will show a list of partitions on the right.  What are the partitions that you see?  For instance, on my sdb drive I have a 98G NTFS partition, a 94M EXT3 partition, a 2.3G linux-swap, a 196G XFS, and 2.4G free.  I would expect you to see one or two NTFS partitions.


----------



## ryoko (Oct 13, 2007)

eb7w5yfe said:
			
		

> ryoko said:
> 
> 
> 
> ...



damn it all. i didn't do anything but use that stupid vista partitioning tool and it fucked shit up to hell and back.  ugh. fuck fuck fuck fuck fuckfukfuckfuckfuck.


----------



## ryoko (Oct 13, 2007)

eb7w5yfe said:
			
		

> Ok, here's a way to look at your partitions from within Knoppix:
> 
> 
> Open up "K Menu"-->"System"-->"QTPartd".  This is a partition manager.  Just be sure to only look; don't make any changes!
> ...



its only showing one partition...


----------



## eb7w5yfe (Oct 13, 2007)

ryoko said:
			
		

> its only showing one partition...


Interesting.  Is there a lot of free space?

If there's only one partition, then whatever is wrong is not due to the computer trying to boot to the wrong partition.

I don't know why Konqueror does not show the partition under media:/ .  Here is something else you can try to get at the data:

In QTPartd look at the name of the partition that you see.  For instance, it might be "/dev/sda1".

Open up Konsole.  It's the icon on the bottom of the screen which looks like a  computer monitor showing a prompt.

Type this: "sudo mount /dev/sda1 /mnt/sda1", substituting the partition name you saw (if you saw /dev/hdd5, you would type "sudo mount /dev/hdd5 /mnt/hdd5")

Open up konqueror again, and in the address bar, type "/mnt/sda1" or whatever you used with the mount command.  This should show you the files.

You don't need to know this, but here is what the command means:
"sudo" -- Super User DO -- Execute this command with administrator privileges
"mount" -- Takes a partition on a drive and attaches it to a directory in the file system, so you can access the data on it.
"/dev/sda1" -- The physical drive and partition to use.
"/mnt/sda1" -- The directory to attach the partition to.

Windows does the same sort of thing, but it's a little more hidden from you.  It looks at partitions on the drives and attaches them to "C:", "D:", "E:", etc.  So you can think of "/mnt/sda1" as similar to "C:", "/mnt/sda2" as "D:", etc.  (This is an oversimplification that may irritate some people who know more about it, but I think it's a close enough explanation to serve for now)


----------



## ryoko (Oct 13, 2007)

i've heard alot of people say that vista doesn't use the same boot...whatever as xp and previous versions do. it may still actually be trying to boot the blank partitioned space on the harddrive that i made....
god vista is so made of fail.


----------



## ryoko (Oct 13, 2007)

typed what you said with the name i saw and this is what it gave back to me... 
knoppix@Knoppix:~$ sudo mount /dev/sda /mnt/sda
mount: you must specify the filesystem type
knoppix@Knoppix:~$


----------



## ryoko (Oct 13, 2007)

also, when i click on the drive or partition or whatever in the qtparted window this error pops up: "critical error during ped_disk_new"

....damnit, what the hell happened to my computer. i didn't do anything to make it do this. i didn't reformat anything, i didn't do ANYTHING ufdjsflkjdflkdsj damn it.


----------



## eb7w5yfe (Oct 13, 2007)

ryoko said:
			
		

> typed what you said with the name i saw and this is what it gave back to me...
> knoppix@Knoppix:~$ sudo mount /dev/sda /mnt/sda
> mount: you must specify the filesystem type
> knoppix@Knoppix:~$


That means that it could not figure out what type of file system it was.  It should have auto-detected NTFS.  I am guessing that you have somehow managed to corrupt the partition, which is why Windows wouldn't boot, and why it didn't show up automatically in Konqueror.

At this point, you may need to use some kind of data recovery software if you want to get your data back.  Maybe someone who knows more about Windows will have a different suggestion.


----------



## ryoko (Oct 13, 2007)

damnit.   i guess i have no choice but to wait till monday or even longer for my mom to get ahold of her work's tech-guy.   damn it, i didn't want to have to wait that long. i cant stand being without a computer.


----------



## net-cat (Oct 13, 2007)

"sda1". not "sda".

Try:

```
sudo mount -t ntfs /dev/sda1 /media/sda1
```


----------



## eb7w5yfe (Oct 13, 2007)

net-cat said:
			
		

> "sda1". not "sda".
> 
> Try:
> 
> ...


Oh jeeze.  How did I miss that?  net-cat is right; listen to him.  Although I _think_ that the "-t ntfs" shouldn't be necessary, it will not hurt anything either.

Edit: also, I'm not sure if /media is correct on Knoppix.  Isn't /media generally for automounted things, while /mnt is for manually mounted things?  If "sudo mount -t ntfs /dev/sda1 /media/sda1" results in a missing directory error, try "sudo mount  -t ntfs /dev/sda1 /mnt/sda1" instead.


----------



## Ron Overdrive (Oct 13, 2007)

Ok sounds like you deleted your partition table. On Knoppix there should be a tool called TestDisk. Open up the Terminal window (should be a little icon on the taskbar for it). Type "sudo -s" (without the quotes) to become root then type "testdisk" (again without quotes). See what comes up and if it does show a deleted partition undelete it and reboot.


----------



## yak (Oct 14, 2007)

Oh, come on guys, he barely knows Windows. With all those advices he'll wipe his harddrive clean.

Look, ryoko, just IM me okay?


----------



## Ron Overdrive (Oct 14, 2007)

yak said:
			
		

> Oh, come on guys, he barely knows Windows. With all those advices he'll wipe his harddrive clean.
> 
> Look, ryoko, just IM me okay?



I agree that telling him to use QParted or GParted is probably not the safest thing to tell him (which is why I didn't suggest it). But it has told me a bit so far. To me it sounds like Knoppix is only detecting the virtual drive its running off of. Linux LiveCD's always mount all mountable hard disks for viewing (at least from my experience) so the user has the option to install it to the hard disk or like in this case recover files. If its not showing his hard disk it may be because there isn't a valid partition table so Linux doesn't know how to safely mount it. TestDisk only does one thing: scans for corrupted/deleted partition tables and gives you the option to repair/restore it which is why I suggested it. From my experience its relatively safe.


----------



## yak (Oct 14, 2007)

Ron, 
stupid Vista probably created that thing called a dynamic disk. That's why it's not accessible nor visible under any other OS to which NTFS is not a native filesystem.

Any attempts to "recover" a virtual partition may lead to the loss of the data on the physical one, which is why i would NOT advice anyone to use linux tools to do that. 

All that needs to be done is to connect the gosh darn hard drive to another PC, copy all the valuable data off it, and repartition & reformat the entire drive. Only this time, use 10G for the system partition, and the rest for a number of other partitions, or just one. 
NEVER store any valuable data on the system drive. Move your "My documents" folder to the other partition, and move your desktop folder there as well (change a bit in the registry to do that). Do not save any files to the system drive, infact, forget the system drive is even available for your use, apart from installing new software.


----------



## net-cat (Oct 14, 2007)

Vista itself takes up about 7GB on a clean install. You'll want 20GB+ for your Vista partition.


----------



## yak (Oct 14, 2007)

Pfft, one more reason i would never install that abomination.


----------



## furryskibum (Oct 14, 2007)

Yeah, I've backed up all my documents onto a spare HD and am getting ready to install Linux.  Always hated windows...


----------



## Ron Overdrive (Oct 14, 2007)

yak said:
			
		

> Ron,
> stupid Vista probably created that thing called a dynamic disk. That's why it's not accessible nor visible under any other OS to which NTFS is not a native filesystem.
> 
> Any attempts to "recover" a virtual partition may lead to the loss of the data on the physical one, which is why i would NOT advice anyone to use linux tools to do that.
> ...



Except you're forgetting one thing: the Windows XP installer isn't recognizing the partition table and Linux isn't recognizing the partition table. Explain to me how another computer is gonna see the data on that hard disk if it doesn't have a valid partition table? Until he repairs the damage he won't be able to recover the data.


----------



## yak (Oct 15, 2007)

Ron Overdrive said:
			
		

> Except you're forgetting one thing: the Windows XP installer isn't recognizing the partition table and Linux isn't recognizing the partition table. Explain to me how another computer is gonna see the data on that hard disk if it doesn't have a valid partition table? Until he repairs the damage he won't be able to recover the data.


I maybe reading the OP wrong, but i remember him saying there were partitions to select from when installing XP, just not the one he created. 
From what i know of the dynamic disks, it's a virtual, software driven partition allocation table within a physical partition. It's a stupid enough concept on it's own, as it makes your data windows-dependent. And i have known many, many cases when people lost their data trying to "recover" it, not knowing what really has happened.


----------



## fastturtle (Oct 28, 2007)

*Ryoko:* I'm going to give you some advice. Knoppix is pretty good but the first thing you need to find out is what happened to the partitions and that's pretty easy. It does not need root acces to do this. Simply clik on the computer icon to bring up a console and type fdisk and it should run without any possibility of screwing the drive up any further. If it doesn't run, you'll have to *sudo* then type *fdisk.*

Once that's up simply press "P" for print. What this will do is show the partition table. At this point, you can see what's been borked and if running it as admin, possible fix the problem. Main thing is if there's an overlapping partition, Sometimes windows does screw up and all you have to do is delete the borked one and only that one. Should allow you to reboot into Windows and start backing up all of your data after making sure it's not fragged.

After backing things up, wipe the drive and using the knoppix disk to boot, start the console and run sudo. Next is to use* cfdisk.* This defaults to the first hard drive in the system. It's a text based partitioning tool that's easier to use then fdisk. Use it to create your partitions as it follows the same verification efforts of Windows. Partitions have to start/end on cylinder boundaries and wont allow you to overlap things like some other tools will. It's also damn reliable because it wont screw the table up so badly you can't get the data off it.


----------



## nobuyuki (Oct 29, 2007)

Hello,

Don't try to "fix" the bootloader for an ntfs file system running Vista within linux using chkdsk/fsck, you will hose it.  Any other NTFS-based windows should load OK though.

you can check /mnt/sda1/boot.ini for your windows partition, if you are able to see that partition (and are able to write to ntfs, I dunno if knoppix can do that yet), you can edit it.  Here's what it should say for a value of default (if this is changed, something may be wrong):



> [boot loader]
> default=multi(0)disk(0)rdisk(0)partition(1)WINDOWS


----------



## GothPanda (Nov 23, 2007)

Okay...  I'm sorry, but if you have to open up a command console, you're getting into stuff that's too advanced.  If you have to type the word "SUDO" at any point and time, DON"T!!!

You obviously need help with this, and you don't get anything but a wiped disk with the word SUDO and no help beside you...

First, Knoppix is good, and a very good recovery, but again, I use (K)Ubuntu for everything...  And I believe that YAk said something about Virtual Drives?  I've not had that problem, but i think I finalized the changes...

IM someone like yak to help you out...  this is going to be a nice weekend project...


----------

