LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   partition trouble gParted (https://www.linuxquestions.org/questions/linux-newbie-8/partition-trouble-gparted-884199/)

lazerking9 06-02-2011 03:01 PM

partition trouble gParted
 
Okay, here's my situation- im running an HP laptop, dualbooting win7/ubuntu 11.04, or rtaher, i WOULD be...

I am trying to manually partition my HDD so that i have
-Windows partitions (the SYSTEM and the main "C:\" drive)
-partition for my personal files, accessable in ubuntu AND windows (NTFS)
-ubuntu itself (11.04 studio).
I have the windows and the personal partition working fine- i even started moving over my music, documents, etc. I opened up gparted from a live CD to make the ubuntu partitions (swap and ext4, i believe). Before i can do anything, gParted gives me a huge list warning about my Windows partition, all of which look like this:

Quote:

ntfsresize v 2.0.0 (libntfs 10:0:0)
Device: /dev/sda2 **(my main "C:\" drive in windows)
Checking filesystem consistency...
accounting clusters...
Cluster accounting failed at 1144554 (0x1176ea): extra cluster
in $Bitmap
cluster accounting failed at 1180814 (0x12048e): extra cluster
in$Bitmap
Cluster accounting failed at 1180815 (0x12048f): extra cluster
in $Bitmap

...
on and on the list goes... i can see 12 such messages, and then its cut off by the bottom of my screen. I ran a full chkdsk in windows at startup, and it hasn't found any problems...

on top of that, it won't let me shrink windows partition so I can move the free space to where I need it... are these connected?

okay, so A)what's happening with these waning messgaes in gParted
B)how do I fix them (non-destructively, if possible)
c)how do I make gParted shrink out the empty space from Windows?

~~~~alec

PS: here's my current disc info:
Code:

ubuntu@ubuntu:~$ sudo fdisk -l -u

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x0008cb12

  Device boot      Start        End      Blocks  Id  System
/dev/sda1  *        2048      206847      102400  7  HPFS/NTFS
Partition1 does not end on cylinder boundary.
/dev/sda2          206848  528718511  264255832  7  HPFS/NTFS
/dev/sda3      528719872  625139711    48209920  7  HPFS/NTFS

ubuntu@ubuntu:~$

SDA1 is the widows system partition, sda2 is windows itself, "C:\", sda3 is my "personal" partition, "D:\".

TobiSGD 06-02-2011 03:08 PM

I don't know about those error-messages, but I would recommend to shrink the Windows partition with Windows' partition manager, since Vista it is perfectly capable of doing that.

lazerking9 06-02-2011 04:54 PM

Partition Manager isn't letting me shrink sda2 / C: partition either- I have almost 80gb free! Is there something I'm doing wrong (or not doing at all?)

Karl Godt 06-02-2011 07:40 PM

There is a bunch of ntfs* commands for the console , try nt[TABTAB] for more info and since ubuntu comes with manpages :
Code:

man ntfsresize
Gparted (GUI) might be a little overcautiously . Some commands like umount return an Errorcode of 1 , even if they are successful . And if Gparted is programmed like loop 12 times and then exit it exits .
for example :
Code:

mkdir -p /mnt/sda3
mount /dev/sda3 /mnt/sda3
Err=$?
echo $Err
umount -l /dev/sda3
UErr=$?
echo $UErr

Code:

modprobe -h || Err=$? && echo $Err
###might be a good example , I guess this h: bug inside modprobe.c still exists on ubuntu

Nevertheless use an older Gparted , wait for a newer one , use or not use the "Round to cylinders" checkbox of the GUI or do it manually .

I am only using ext-fs
but as an example , you can create a ramdisk like
Code:

mkfs.ext2 -v -b 1024 -i 1024 /dev/ram8
in RAM an play a little with that .

yancek 06-02-2011 07:43 PM

Your fdisk output above shows a minimal amount of space between sda2 and sda3 as well as at the end of sda3. Where are you seeing that you have 80GB of free space? Have you made a change since you posted your fdisk info? Are you using GParted or the windows Partition manager? It would help if you listed the specific steps you take and results.

TobiSGD 06-03-2011 01:12 AM

The OP stated clearly that he can't resize his Windows partition, neither with GParted nor with the Windows partition manager, although he has 80GB of free space on that partition.

Karl Godt 06-03-2011 09:09 AM

This is the first functional shellscript to play with the commands :
Code:

#!/bin/ash
for i in `mount | grep 'ram0' | cut -f 3 -d ' ' |sort -r` ; do
echo $i
umount -l $i
sleep 3s
rmdir $i
done
mkdir -p /mnt/ram0
mkfs.ext2 /dev/ram0
mount -t ext2 /dev/ram0 /mnt/ram0
dd if=/dev/zero of=/mnt/ram0/part1 bs=1048576 count=3
mkswap /mnt/ram0/part1
swapon /mnt/ram0/part1
cat /proc/swaps
ls -ls /mnt/ram0
free
df
dd if=/dev/zero of=/mnt/ram0/part2 bs=1048576 count=4
mkfs.ext2 /mnt/ram0/part2
mkdir -p /mnt/EXT2
mount -t ext2 -o loop /mnt/ram0/part2 /mnt/EXT2
df
dd if=/dev/zero of=/mnt/ram0/part3 bs=1048576 count=5
mkfs.ntfs -F -H 100 -S 5 -s 256 -p 0 /mnt/ram0/part3
mkdir -p /mnt/NTFS
mount -o loop -t ntfs /mnt/ram0/part3 /mnt/NTFS
df
umount -t ntfs /mnt/NTFS
ntfsresize -s 3M -f -v /mnt/ram0/part3

And you can use
Code:

ntfscluster -if /mnt/WINDOWSPARTITION
to gain the needed variables like SECTORS/HEADS ....

For fsck'ing I have fsck.msdos and fsck.vat available but it might be a fsck.ntfs available on ubuntu .


All times are GMT -5. The time now is 04:41 AM.