LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   can't repartiton hard drive for a dual boot because disk contains data near end (https://www.linuxquestions.org/questions/linux-newbie-8/cant-repartiton-hard-drive-for-a-dual-boot-because-disk-contains-data-near-end-382812/)

andy101 11-13-2005 05:14 PM

can't repartiton hard drive for a dual boot because disk contains data near end
 
I want to install linux, but I still need to keep Windows because there are some apps I need that won't run under linux. I only have one hard disk (160gig).

I've been told that I need a different partition for Linux. I have tried resizing my NTFS windows partition using QT Parted (from a Knoppix Live CD) but it can't resize it because there isn't enough free space at the end of the partition.

I have tried using Windows disk defragger again and again (at least 10 times now, possibly 20 times) and each time it leaves something near the end. Though its not marked as "unmovable". Anyone know any way I can either get disk defrager to move the offending data nearer the front of the disk or to find out exactly which files are in the way (so i can erase them, if they're not important). I have over half my Hard drive free so I would have thought it would have plenty of space to put my files somewhere closer the beginning. Is windows disk defragger configured to leave stuff at the end of the disk to stop people installing dual boots or something because I have been repeatedly defragging my hard drive all day and whatever I do it always has the same small amount of data near the end. All I want is about 35 gig at the end to use for Linux.

Thanks

Tinkster 11-13-2005 05:21 PM

Norton Utilities and some other Norton tools tend to stick
stuff at the far end of the hdd and make them "system", so
defragging can't move them... also, can you find out (using
whatever tools windows has for that purpose) which files
they are and maybe manually move/remove them?


Cheers,
Tink

bigrigdriver 11-13-2005 08:30 PM

It might be possible to do it from a live cd, or a distro install cd if it allows you to boot a running Linux from the cd (as a live cd would do).

There is a set of utilities for working with ntfs partitions, called ntfsprogs. One of the set is ntfsresize. It allows you to resize the filesystem (not to be confused with resize the partition). While the man page doesn't specifically say ntfsresize will move those files at the end of the partition, that's the sense I got on reading the man page.

After resizing the filesystem, you then resize the partition with something like parted or cfdisk (I prefer cfdisk; it's easier to work with).

You must run ntfsresize and partitioner on an unmounted partition, and you MUST be careful to resize the partition to a size larger than the resized filesystem, or risk losing data.

So, with 160G to work with, resize the ntfs filesystem to 100G. Then resize the partition to 130G (creates a 30G buffer zone between the end of the filesystem and the end of the partition. After that, create a new 30G partition at the end of the disk for Linux, flag it as bootable, format it, write the partition table.

Then reboot into windows and defrag to expand the filesystem to the size of the windows partition.

Then install Linux. Try to boot Linux. If you get error messages about exceeding the 1024 cylinder limit, I didn't say any of this.

andy101 11-14-2005 01:52 PM

Now I feel like an idiot, I tried QTParted again, only this time it worked! Shrank my NTFS partition. When I rebooted my machine however windows noticed I had done something to the hard disk and insisted on scanning it. After it finished and rebooted itself everything seems to work fine, or more precisely I haven't noticed any damage ;). not sure why it failed the first time, possibly user error grr. Now to add Linux, wish me luck ;). Will probably have some food first though.

Thanks for your help


All times are GMT -5. The time now is 03:26 AM.