I think I copied a file over my entire Windows partition
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The reinstall would not reset anything on partitions it did not write to. Ubuntu just looks at what the partition boot record and file system tables show. My guess is that the boot record still contains elements copied from the iso file.
that I can maybe preserve my Windows XP install using dd to clone my Windows partition. However, since my goal is to get rid of these pesky MBR/partition problems, is there a way to do this that will ensure a fresh start when I copy everything back?
e.g. I want to keep my Windows apps, data, settings, but have it all be on a freshly partitioned drive.
Before going through allot of work, you should try Windows System Restore and restore it to a time prior to the incident, you can reverse any restore back to where you are now if it does not pan out. The dd copy will be exactly the same as the original. I don't think the partition table in the MBR is preventing Ubuntu from mounting Windows, rather it is errors in the NTFS partition.
Of course, any filesystem at all is subject to corruption; the problem with NTFS is that Windows doesn't periodically check it - unless, that is, Windows finds itself unable to start.
One of the ideas behind a journaling file system is to avoid the lengthy times it takes for a file system integrity check utility to check the file system on a very large drive/partition. Because of journaling, file system check utilities just check the changes that were last implemented as reported in the journal.
EDIT: You can also run scandisc manually in Windows XP by opening My Computer and right clicking on the drive and select "properties/tools/error checking"
Last edited by Junior Hacker; 05-23-2007 at 05:14 PM.
You can use udevinfo to examine the present uuid on the filesystem. One of the ntfstools programs may be able to create a new UUID number for your ntfs filesystem.
udevinfo -q env -n /dev/sda1
Look at what the label on the partition says as well.
I just tried using dd to overwrite the MBR completely to be zeros using
Code:
dd if=/dev/zero of=/dev/sda1 bs=512 count=1
Ubuntu booted up after that, so maybe I should have done /dev/sda instead of /dev/sda1. I'm trying obliterate the MBR and partition table and rebuild it, hopefully removing traces of the "vmware tools" iso.
Thing is, the Windows partition works OK (After fixboot), it's mountable, writable in ubuntu, boots into Windows ok, but it shows up as a joliet filesystem.
If you wipe out the mbr, you won't be able to boot, and you will loose the partitioning information.
You could relabel the disk either in windows for a windows partition or using ntfslabel.
What does "sudo file /dev/sda1" say about the filesystem?
Look at "sudo /sbin/fdisk -l". Is the filesystem ID a 7? (Although there isn't an iso9660 filetype entry, so maybe that isn't where the system is thinking the fs is iso9660.)
Example:
Code:
Disk /dev/hda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 3786 30409287 7 HPFS/NTFS
If the files are now readable, you might want to backup the files, reformat the partition, and restore the files you need.
If you actually did this, you wiped out the boot record on that partition. This will keep you from accessing that partition. You'll need to fix that. This is your ntfs partition, right? There are tools to fix it. I believe testdisk will fix it.
Quote:
Ubuntu booted up after that, so maybe I should have done /dev/sda instead of /dev/sda1. I'm trying obliterate the MBR and partition table and rebuild it, hopefully removing traces of the "vmware tools" iso.
Well, I did the overwriting the MBR of /dev/sda. I then used GPartEd and testdisk to rebuild the partition table.
Still the same (though I had to reinstall grub to the MBR). Where on earth is Ubuntu getting the information it lists in the Device Manager and properties->volume?
"sudo fdisk -l" shows the partition as type 7 and "sudo file /dev/sda1" comes back "/dev/sda1: block special (8/1)"
Last edited by transparent9; 05-24-2007 at 12:46 AM.
Well, I did the overwriting the MBR of /dev/sda. I then used GPartEd and testdisk to rebuild the partition table.
Still the same (though I had to reinstall grub to the MBR). Where on earth is Ubuntu getting the information it lists in the Device Manager and properties->volume?
"sudo fdisk -l" shows the partition as type 7 and "sudo file /dev/sda1" comes back "/dev/sda1: block special (8/1)"
Ok, I think I was able to repair what was wrong. Instead of just wiping the MBR, I used dd to write zeros to the first 13.8mb of the disk, the same size as the iso I accidentally copied to /dev/sda1. Then I did the same stuff as before, repaired the partition, MBR, fixboot. I haven't checked to see if Windows boots yet, but I'm confident that I can get that working.
Now in ubuntu, things appear to be correct. The volume now mounts as "sda1" instead of "vmware tools" and it reports the volume as NTFS in both properties and the device manager.
Here's the output of "file -s /dev/sda1" before the changes (I made a clone with dd):
Code:
/dev/sdc1: ISO 9660 CD-ROM filesystem data UDF filesystem data (unknown version, id 'NSR0h') 'VMware Tools
Here's after the changes:
Code:
/dev/sda1: x86 boot sector, code offset 0x52, OEM-ID "NTFS ", sectors/cluster 8, reserved sectors 0, Media descriptor 0xf8, heads 255, hidden sectors 63, dos < 4.0 BootSector (0x0)
Now the only thing that I'm wondering is if I need to set a UUID for the NTFS volume somehow. I think prior to the mishap, there was a UUID, but I haven't been able to find anything on how to set UUIDs for NTFS volumes (lots of stuff on how to set them for ext2/3). Is setting a UUID even necessary or preferred? What I'm reading around the forums is that it's a choice?
One thing's for sure-- I have learned more about partitions and MBRs than I ever expected or cared to!
Last edited by transparent9; 05-24-2007 at 08:40 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.