Thursday, June 2, 2016

dual boot - Why did my Gparted operation fail during the file system check?


I was trying to move free space from my ubuntu partiton to my windows partiton, but i got an error message.
I was trying to follow these instrucitons with a bit of variaton due to a different setup (I had no sda4): Is it possible to move free space from Ubuntu partition to Windows, when Windows is located before Ubuntu?


It moved /dev/sda6 (Ubuntu Partition) to the right and shrank it from 135.36 GiB to 48.83 GiB.
It moved /dev/sda5 (Linux Swap) to the right
It moved /dev/sda3 (extended linux partition?) to the right and shrank it from 150.26 GiB to 63.73 GiB
However, it failed to grow /Dev/sda2 (Windows 7 partition) from 781.15 GiB to 867.68 GiB. It also told me to make sure to send my GParted details, so here you go.


Upon closer inspection, the details section says that checking the filesystem on /dev/sda2 for errors failed. Is that because Gparted reported that it was unable to read the contents of the Windows 7 file system? Because Gparted did say that it might need ntfsprogs / ntfs-3g, but when I tried to install them from my live cd it said that they were already installed.



Chances are you need to repair the Windows 7 disk from within Windows. There are no tools in Ubuntu that can do this job. (The ntfsfix program does only the most basic checks and then flags the partition as needing repair in Windows.) Also, be sure you shut down the computer in Windows; do not perform a suspend-to-disk operation. The latter leaves the filesystem in an inconsistent state, which will prevent GParted from resizing it.


Finally, you might consider resizing the NTFS partition from Windows; that's likely to be safer than using GParted. NTFS is proprietary, and Linux tools to manipulate NTFS are all reverse-engineered. That doesn't guarantee that Microsoft's tools will be superior, but if I had to place money on it, I'd bet that the Windows NTFS-resizing tools are safer than GParted. Also, GParted is known to be unable to adjust pointers used by Windows boot loaders. If the resize operation happens to change the start point, using GParted will render Windows unbootable. Doing the same with the Windows tools should cause no such problems. Note that the start point might change even if you don't tell the program to make that change. This can happen if your alignment policies don't match those in use when the partition was created.


Oh, and back up. Resizing and moving partitions are inherently dangerous procedures. They work fine most of the time, but a power failure at an inopportune time, a bug, filesystem corruption, or other problems can all result in catastrophic data loss. ("Catastrophic," in this case means "many hours wasted trying to recover your data, with Murphy's Law guaranteeing that your most important files will end up lost forever.")


One more point: Instead of expanding your existing Windows partition, you might consider creating a new one for data files. This will be safer than creating a new partition, and will have the advantage that you can use it as a shared-data partition, thus eliminating the need to access the main Windows partition from Ubuntu. Such non-Windows access is inherently dangerous and so should be avoided if possible.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...