purple_monkfish Posted April 1, 2008 Report Share Posted April 1, 2008 Windows crashed on me, again.. thanks in part to various viruses so i've booted up Ubuntu off a cd which at the very least gives me internet access. However, I want to access my hard drive (it's partitioned into two parts via win2k) but have no idea where to start.I'm a complete linux noob i'm afraid.I need to back things up (again) before I can wipe my hard drive completely and start again so any help in mounting and accessing those drives would be appreciated. I'm not sure if they're NTFS or FAT, I have the feeling that for some reason the partition is fat and the other is default ntfs but i'm not 100% certain. When I go into browser I can see what it claims is a 200gb hard drive (sounds about right) but it tells me when I click on it that it isn't able to access it, it isn't mounted properly. Help!thanks! Quote Link to post Share on other sites
iccaros Posted April 1, 2008 Report Share Posted April 1, 2008 open a command console if its an IDE drivesudo - suenter your password (live cd ?? it may not ask)type mkdir /mnt/windows1mount /dev/hda1 /mnt/window1if its a sata drive (or SCSI)do the same but the mount command ismount /dev/sda1 /mnt/window1post any error that pop up and we can go from there... with out more information its hard to say... also that live cd may not have ntfs3g and in that case will not be able to mount the NTFS partition... Quote Link to post Share on other sites
purple_monkfish Posted April 1, 2008 Author Report Share Posted April 1, 2008 open a command console if its an IDE drivesudo - suenter your password (live cd ?? it may not ask)type mkdir /mnt/windows1mount /dev/hda1 /mnt/window1if its a sata drive (or SCSI)do the same but the mount command ismount /dev/sda1 /mnt/window1post any error that pop up and we can go from there... with out more information its hard to say... also that live cd may not have ntfs3g and in that case will not be able to mount the NTFS partition...Ok, Hda1 - Special device hda1 does not existSame for sda1Either they have different names or it's unable to read/detect ntfs.Suggestions? Quote Link to post Share on other sites
hitest Posted April 1, 2008 Report Share Posted April 1, 2008 open a command console if its an IDE drivesudo - suenter your password (live cd ?? it may not ask)type mkdir /mnt/windows1mount /dev/hda1 /mnt/window1if its a sata drive (or SCSI)do the same but the mount command ismount /dev/sda1 /mnt/window1post any error that pop up and we can go from there... with out more information its hard to say... also that live cd may not have ntfs3g and in that case will not be able to mount the NTFS partition...Ok, Hda1 - Special device hda1 does not existSame for sda1Either they have different names or it's unable to read/detect ntfs.Suggestions?After you have root access try typing fdisk -lThat may show what your HD label is. Quote Link to post Share on other sites
purple_monkfish Posted April 1, 2008 Author Report Share Posted April 1, 2008 (edited) Nope, but I tried taking away the number and mount hda seemed to do something. It's told me: dev/hda is write protected, mounting read onlyProgress? maybe...Trying to mount SDA (which is what it claims my large file system is it says: Cannot read superblock. Edited April 1, 2008 by purple monkfish Quote Link to post Share on other sites
iccaros Posted April 1, 2008 Report Share Posted April 1, 2008 this is progress, sorry it was late last night. This means that hda is your cdrom/dvd what everand sda is your harddrive, but NTFS has not unmounted it or has damaged itcan you as root type ntfs and hit tab twice and post what ntfs tools are showing up on your system.. we may be able to fix this..superblocks are were the drive markes sections in a partition.. you can normally fix superbloc issues in a UNIX FS, but I am not soure about NTFS Quote Link to post Share on other sites
purple_monkfish Posted April 2, 2008 Author Report Share Posted April 2, 2008 ntfs-3g ntfscluster ntfsdecrypt ntfslabel ntfsresizentfscat ntfscmp ntfsfix ntfsls ntfsundeletentfsclone ntfscp ntfsinfo ntfsmount Ahh, partition thing makes sense, as I said, my harddrive was partitioned into two parts because my father in his infinite wisdow decided it was better than having two independent drives (bah, bah I say. I would have prefered two drives so I could access at least one of the damned things) Quote Link to post Share on other sites
iccaros Posted April 2, 2008 Report Share Posted April 2, 2008 progress.. I love (I have gotten more than 3 hours of sleep... oh ya your issues:) )please run fdisk -l /dev/sdaand see what partitions are listedthen run ntfsfix /dev/sda and see what it tells your, please post the output (a simple way of doing this isntfsfix /dev/sda > /tmp/fixntfs.txt and post the contents of that file....some light reading.. ntfsfix Quote Link to post Share on other sites
purple_monkfish Posted April 2, 2008 Author Report Share Posted April 2, 2008 fdisk -l doesn't seem to do anything at all, it doesn't give me any output.root@ubuntu:/home/ubuntu# ntfsfix /dev/sdaMounting volume... Failed to startup volume : Invalid argumentFAILEDAttempting to correct errors... FAILEDFailed to startup volume : Invalid argumentVolume is corrupt. You should run chkdsk.That, doesn't look good. Quote Link to post Share on other sites
iccaros Posted April 3, 2008 Report Share Posted April 3, 2008 I need to install some tools, I just rebuilt my laptop... (yes it running windows for developmet and I need to reactivate my ubuntu partition.. ) so as soon as I get that done I'll test these command on my NTFS partition Quote Link to post Share on other sites
iccaros Posted April 3, 2008 Report Share Posted April 3, 2008 it should run like thisstevelinux ~ # fdisk -l /dev/hdaDisk /dev/hda: 30.7 GB, 30750031872 bytes255 heads, 63 sectors/track, 3738 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/hda1 * 1 10 80293+ 83 Linux/dev/hda2 11 141 1052257+ 82 Linux swap / Solaris/dev/hda3 142 3738 28892902+ 83 Linuxstevelinux ~ #but yours would be sda not hda Quote Link to post Share on other sites
purple_monkfish Posted April 3, 2008 Author Report Share Posted April 3, 2008 Disk /dev/sda: 320.0 GB, 320072933376 bytes255 heads, 63 sectors/track, 38913 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDisk identifier: 0x69737369This doesn't look like a partition tableProbably you selected the wrong device. Device Boot Start End Blocks Id System/dev/sda1 ? 116388 126889 84344761 69 UnknownPartition 1 does not end on cylinder boundary./dev/sda2 ? 105915 222310 934940732+ 73 UnknownPartition 2 does not end on cylinder boundary./dev/sda3 ? 1 1 0 74 UnknownPartition 3 does not end on cylinder boundary./dev/sda4 1 213826 1717556736 0 EmptyPartition 4 does not end on cylinder boundary.Partition table entries are not in disk orderHmm.. Quote Link to post Share on other sites
iccaros Posted April 3, 2008 Report Share Posted April 3, 2008 it looks like you have some disk errror. the bad news is that you need to chkdisk from a windows (same version that formated)this is because NTFS is not documented from microsoft and all of the Linux drivers are created by hacking the drive..now you can use vmware or virtual box to host the windows and tell it that its disk is a real partition.. you can for fun run ntfsfix on /dev/sda1 and on /dev/sda2 Quote Link to post Share on other sites
purple_monkfish Posted April 4, 2008 Author Report Share Posted April 4, 2008 Hmmm, well given that I can't even open windows it's that corrupt... Not a good thing ever. Maybe I can sacrifice an old pc with an old windows installation to gain access to the drive as a slave drive. Within moments i'm sure the viruses would infect the second pc but it might buy me enough time.. maybe. I'd have to check to see if my old pc has windows still installed on it but I think that hard drive is completely corrupt and unsalvagable. I'll have to find a cheap small drive to install windows on.So, step by step.. i'd need to access windows and run chkdsk, then run virtualbox? What is that? remember, i'm a noob lol.Both sda1 and sda2 give me the same response, run chkdsk, drive corrupt. Quote Link to post Share on other sites
iccaros Posted April 5, 2008 Report Share Posted April 5, 2008 we like noob'sok..forget the Virtual machine part, on latter look it seams that only VMware workstation lets you mount a real drive...so if you have another windows box, then a great tool all computer people need is a IDE or sata to usb adaptorsince you have sata drives this is my favourite http://www.crazypc.com/products/blacx-95470.htmlplug in the adaptor into the other machine, and plug in the hardrive. windows should see the drive if not.. then you how important is the data on the drive? Note: you do not need to worry about virus on a second drive if you do not run any software from the drive.. right click on the drive and run check disk for errors..this should fix the issues.. now assuming all is good with the drive then you can try to run WinClam to look for viruses.. if the harddrive is 2 or more years old, it may just be a bad harddrive and not a virus.. Quote Link to post Share on other sites
purple_monkfish Posted April 6, 2008 Author Report Share Posted April 6, 2008 Well i'll have to leave it for now then, least till I have the time to spend slaving drives etc etc. The drive itself, i don't actually know how old it is, it was a replacement for my last drive which died quite thoroughly a few years back. I seem cursed when it comes to hard drives, they last for about a year then just explode heh.. what do I do to them!? I think most of the really really important data is backed up on the internet (like art, photos etc) but there's a few things i'd like to be able to save if I can. Mostly my MP3s because oh dear god i'm not going to burn 200 cds again. I know viruses are mostly responsible but it is possible they may have just helped accelerate the problem windows seems to have with devouring my hard drives. Anyway, thank you so much for your help! Shame we couldn't fix things the easy way aye? Quote Link to post Share on other sites
iccaros Posted April 6, 2008 Report Share Posted April 6, 2008 sorry, unless someone else has an answer, you can also try the windows forum.. they are also smart.. its a shame the NTFS schema is so undocumented.. it has taken years just to read and write to it. there are some recovery tools that should allow you to grab data off the disk, but since I normally just wipe and forget.. Quote Link to post Share on other sites
hitest Posted April 6, 2008 Report Share Posted April 6, 2008 Yeah, maybe the windows guys can help. If all else fails I do what iccaros does. Pop in your Ubuntu CD, reboot and wipe your windows partition, and install Linux. You'll have no issues with viruses, malware running Linux.Then you'd at least be able to use this computer. Good luck with this. Quote Link to post Share on other sites
jcl Posted April 6, 2008 Report Share Posted April 6, 2008 Device Boot Start End Blocks Id System/dev/sda1 ? 116388 126889 84344761 69 UnknownPartition 1 does not end on cylinder boundary./dev/sda2 ? 105915 222310 934940732+ 73 UnknownPartition 2 does not end on cylinder boundary./dev/sda3 ? 1 1 0 74 UnknownPartition 3 does not end on cylinder boundary./dev/sda4 1 213826 1717556736 0 EmptyPartition 4 does not end on cylinder boundary.Partition table entries are not in disk orderIt's occured to me that it would be a good idea for people to record their partition maps somewhere so they can reconstruct the partition tables if needed. Rebuilding the master partition table, at least, is easy if you know the layout and formats of the partitions.Alternatively, someone could do something really crazy like store backup copies of the boot sector at known locations on the HDD -- like, say, the second sector -- and provide an option to redirect the BIOS to them. Or, gee, I don't know, save a copy in the CMOS or BIOS PROM, if the massive 64 bytes of storage that's required isn't too expensive. Quote Link to post Share on other sites
iccaros Posted April 7, 2008 Report Share Posted April 7, 2008 (edited) I remember doing this in solars (and sun OS), but I could not even begin to know how to do this for windows. I guess you can use linux...here is a how to http://martybugs.net/linux/image.cgiackup the Partition TableTo backup the partition table to a file, we can use dd as follows: dd if=/dev/hda of=/mnt/hdc1/my-hda.mbr count=1 bs=512Linux treats a filesystem or a partition as a file, and the syntax above specifies the input file to be the /dev/hda partition, and the output file is a file on our target HDD. The other parameters specify that only a single block should be copied, and we're forcing the filesize to be 512 bytes.The output filename is arbitrary, so give it a suitable name that indicates which HDD it relates to. A ".mbr" file extension indicates it contains details relating to the master boot record.Backup Extended Partition InformationIf you have any extended partitions on the HDD being imaged, the details of the extended partitions can be saved as follows: sfdisk -d /dev/hda > /mnt/hdc1/my-hda.sfThis will dump the partition table contents into the file we specify, in a format suitable for easily rebuilding the partition table.Again, the output filename is arbitrary, so use a suitable filename.to restore# se dd to restore the partition table (dd if=/mnt/hdc1/my-hda.mbr of=/dev/hda)# use sfdisk to restore the extended partition information (sfdisk /dev/hda < /mnt/hdc1/my-hda.sf) Edited April 7, 2008 by iccaros Quote Link to post Share on other sites
jcl Posted April 7, 2008 Report Share Posted April 7, 2008 I remember doing this in solars (and sun OS), but I could not even begin to know how to do this for windows.AFAIK it's basically the same on Windows. The physical disks can be accessed via Win32 at \\.\PhysicalDriven for n >= 0.Once you have the boot sector you can extract or modify the partition table easily enough. The format is dead simple if the bootloader uses LBA and not much more complicated if it uses CHS addressing. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.