LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 06-28-2005, 11:13 PM   #1
Steel3
LQ Newbie
 
Registered: Jun 2005
Posts: 10

Rep: Reputation: 0
Partitioning Problems; Installing Windows after Linux difficulties


Hey all. Did a search, tried to look it up on the internet, posted over at the Ubuntuforums with no luck, so I figured I'd come here. Anyway, here goes...

I apologize if this is the wrong forum; wasn't really sure where to put this.

Anyway, for various reasons I need to start running the Windows OS again after almost an entire year of having ditched it completely. I'm a total newb when it comes to all of this GRUB/dual-booting/partition table type stuff. Since my computer is currently nonfunctional (more on that later), I wrote down my most recent fdisk -l output from a Live CD (in case that is helpful):

Device Boot Start End Id System
/dev/hda1 1 7786 83 Linux
/dev/hda2 7787 19457 f W95 Ext�d (LBA)
/dev/hda3 * 13385 19457 c W95 FAT32 (LBA)
/dev/hda5 7787 13322 c W95 FAT32 (LBA)
/dev/hda6 13323 13384 82 Linux swap

The FAT partitions are a throwback from when I used to dual boot so I could access and modify my Windows storage space from my real OS. I initially tried Qemu, and it seemed to work out pretty nicely, except I couldn't manage to get network/internet access or sound working, which are essential to the applications that I need Windows for (cedega/crossover office/wine just don't do the trick, unfortunately).

Anyway, first I tried using GParted and QTParted (had all of the necessary libraries that I needed) to just get rid of the two FAT partitions (they're empty now), resize the ReiserFS partition to take up most of the space and leave 8-10 gigs of FAT for Windows. Unfortunately, neither program could read the partition table on hda and spit out a slew of errors at me.

Finally I decided to just take the plunge and install Windows XP on one of the now-empty FAT partitions (I picked what it thought was the "D" drive, hda3). After going through the initial install process where it copies the setup files onto the drive before rebooting to run the actual installation, the computer... wouldn't reboot. Now normally (and in Qemu) the computer just booted without the CD, asked for the CD, and continued with the installation. This time it gave some error about not being able to find a disk, so I was just like "screw it," popped in a Warty LiveCD that I had lying around, and followed the instructions in this thread and wrote GRUB to (hd0) (the MBR?). Anyway, after I tried to add a entry to Windows in GRUB when I try to load it it still went "disk error" or "disk not found" or something like that.

So a few days later I decide to try it again, figure maybe I'll do things differently. I tell Windows to install on that same partition, and everything craps out on me again. I get the same error and I've got to use a LiveCD to boot up, except this time the LiveCD encounters some fatal error when its trying to load up and I've got to load it in failsafe mode to even boot up. Rescuing the computer is not going to be a difficulty now that I've got internet access someplace else and printed out what to do, but I've got a few questions about this situation:

What am I doing correctly in the installation of Windows, and is there a process I can follow to install it correctly?

Is there any way I can get parted to "see" all of the partitions on my drive? I've got all the necessary programs and I'm not exactly sure what to do so I can repartition my computer correctly.

I can supply you guys with any other information as necessary. Sorry for the trouble and thanks in advance!

followup post:

UPDATE: So I tried to run parted from a LiveCD. Does this message mean that my MBR is screwed up or something, or is it related to me not being able to partition properly?

warty@ubuntu:~ $ sudo parted
GNU Parted 1.6.9
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.

Using /dev/hda
Warning: Unable to align partition properly. This probably means that another
partitioning tool generated an incorrect partition table, because it didn't havethe correct BIOS geometry. It is safe to ignore,but ignoring may cause
(fixable) problems with some boot loaders.

More info:

Sorry for yet another update, but this is really bothering me and I can't seem to figure it out.

Anyway, I downloaded and burned the Breezy Live CD, booted it up, added all of the repositories, updated and installed various programs related to reiserfs and parted. This is my fdisk output.

Device Boot Start End Blocks Id System
/dev/hda1 1 7786 62541013+ 83 Linux
/dev/hda2 7787 19457 93747307+ f W95 Ext'd (LBA)
/dev/hda3 * 13385 19457 48781341 c W95 FAT32 (LBA)
/dev/hda5 7787 13322 44467857 c W95 FAT32 (LBA)
/dev/hda6 13323 13384 497952 82 Linux swap / Solaris

I figured since everything was unmounted and hda wasn't being used I'd give it another shot. With parted, I get the error message "Error: Unable to satisfy all constraints on the partition." when I try to do something. Other programs see the hard drive, but see it as completely unallocated space. With QTParted I get the error message "Critical error during ped_disk_new"

What gives? Is there any information out there about how to fix something like this?

Thanks!
 
Old 06-28-2005, 11:21 PM   #2
Bluenoser
Member
 
Registered: Jun 2004
Location: Nova Scotia, Canada
Distribution: Ubuntu 8.04 LTS
Posts: 138

Rep: Reputation: 15
Is there anything you need to save or backup off of any of the partitions? If not I would pop in the xp cd and wipe the hard drive and start fresh.
 
Old 06-28-2005, 11:43 PM   #3
Steel3
LQ Newbie
 
Registered: Jun 2005
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Bluenoser
Is there anything you need to save or backup off of any of the partitions? If not I would pop in the xp cd and wipe the hard drive and start fresh.
Yeah, that's kinda one of the problems. Backing up all of my music/documents/other data would take WAYYY more DVDs than what i've got on me. I wouldn't be opposed to somehow figuring out how to throw everything important on a partition, wipe everything else, and go from there. However, I'm not sure if that'd be substantially easier from working this out.
 
Old 06-29-2005, 12:16 AM   #4
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
To run, Windows requires some disk space at the beginning of the disk (~30-40M), i.e. you should have some free space at the beginning of the disk before you install Windows. Windows itself can be anywhere in the disk.
If you want to partition you hard drive, you may have a look at my 1st link.
NTFS resizing is done with "fdisk" and "ntfsresize" there.
If you understand the principle, you can then:
1) resize Ext2/Ext3 with "resize2fs" and "fdisk";
2) resize ReiserFS with "resize_reiserfs" and "fdisk".
I've resized my ReiserFS just yesterday, all works just fine.

If you want GUI partitioner, I do recommend GParted. It's much better than QtParted.
 
Old 06-29-2005, 12:34 AM   #5
Steel3
LQ Newbie
 
Registered: Jun 2005
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by kornerr
To run, Windows requires some disk space at the beginning of the disk (~30-40M), i.e. you should have some free space at the beginning of the disk before you install Windows. Windows itself can be anywhere in the disk.
If you want to partition you hard drive, you may have a look at my 1st link.
NTFS resizing is done with "fdisk" and "ntfsresize" there.
If you understand the principle, you can then:
1) resize Ext2/Ext3 with "resize2fs" and "fdisk";
2) resize ReiserFS with "resize_reiserfs" and "fdisk".
I've resized my ReiserFS just yesterday, all works just fine.

If you want GUI partitioner, I do recommend GParted. It's much better than QtParted.
Well, I've got all of the tools to resize reiserfs and all of that like you mentioned, the problem is that programs like GParted (yeah, i've tried that too) can't see the partition table for some reason. You've seen my fdisk output, they're there, but... for example, when I run GParted:

the pulldown menu lets me select /dev/hda (152,625 MB), but the problem is that it lists all of it as "unallocated" space instead of showing each of the different partitions. Parted gives me the error message "Error: Unable to satisfy all constraints on the partition." and QTParted a similar error message.

And I didn't know that about the needing free space at the beginning of the disk, if I can get repartitioning to work correctly I might give that a whirl.
 
Old 06-29-2005, 02:19 AM   #6
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
If "fdisk" sees you Partition Table, all's ok.
The only "problem" I see in your Partition Table is that partitions are not in disk order. I.e. /dev/hda5 should be /dev/hda3, /dev/hda5 should be /dev/hda4, /dev/hda3 should be /dev/hda5. Although it's not harmful.
So what do you want? Resize?
This way use only "fdisk" and "resize_reiserfs" without *Parted.
I've already said - it works for me just fine.
 
Old 06-29-2005, 02:41 AM   #7
Steel3
LQ Newbie
 
Registered: Jun 2005
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by kornerr
If "fdisk" sees you Partition Table, all's ok.
The only "problem" I see in your Partition Table is that partitions are not in disk order. I.e. /dev/hda5 should be /dev/hda3, /dev/hda5 should be /dev/hda4, /dev/hda3 should be /dev/hda5. Although it's not harmful.
So what do you want? Resize?
This way use only "fdisk" and "resize_reiserfs" without *Parted.
I've already said - it works for me just fine.
Cool! Well, what I want to do is get rid of the FAT partitions and resize reiserfs until it takes up almost all of the space on the drive. Is there any way to delete the partitions, specify the amount of space i want to resize it to, and make sure i don't screw things up majorly? So its not bad that no partitioning program can see the drives?

EDIT: Maybe if its a problem with the order, after I remove the FAT partitions the partitioning programs will be able to see it again. Who knows.
 
Old 06-29-2005, 03:56 AM   #8
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
To make your first ReiserFS partition occupy all hard drive without data loss (and delete all other partitions), do:
1) format your floppy into Ext2:
Code:
fdformat /dev/fd0
mkfs -t ext2 /dev/fd0
2) mount your floppy:
Code:
mount -t ext2 /dev/fd0 /mnt/floppy
3) copy "resize_reiserfs" to floppy:
Code:
cp /sbin/resize_reiserfs /mnt/floppy
4) boot with Install CD;

5) run "fdisk";
5.1) delete all partitions;
5.2) create new partition occupying all hard drive;
5.3) set the partition's type to 83 (Linux partition);
5.4) save changes;

6)
Code:
mkdir -p /mnt/floppy
mount -t ext2 /dev/fd0 /mnt/floppy
ln -s /mnt/floppy/resize_reiserfs /sbin/resize_reiserfs
7)
Code:
resize_reiserfs -s your_hard_drive_size /dev/hda1
You can take your_hard_drive_size in KB by running
Code:
fdisk - l /dev/hda
before running "resize_reiserfs" (Blocks column).
 
Old 06-29-2005, 11:32 AM   #9
Steel3
LQ Newbie
 
Registered: Jun 2005
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by kornerr
To make your first ReiserFS partition occupy all hard drive without data loss (and delete all other partitions), do:
1) format your floppy into Ext2:
Code:
fdformat /dev/fd0
mkfs -t ext2 /dev/fd0
2) mount your floppy:
Code:
mount -t ext2 /dev/fd0 /mnt/floppy
3) copy "resize_reiserfs" to floppy:
Code:
cp /sbin/resize_reiserfs /mnt/floppy
4) boot with Install CD;

5) run "fdisk";
5.1) delete all partitions;
5.2) create new partition occupying all hard drive;
5.3) set the partition's type to 83 (Linux partition);
5.4) save changes;

6)
Code:
mkdir -p /mnt/floppy
mount -t ext2 /dev/fd0 /mnt/floppy
ln -s /mnt/floppy/resize_reiserfs /sbin/resize_reiserfs
7)
Code:
resize_reiserfs -s your_hard_drive_size /dev/hda1
You can take your_hard_drive_size in KB by running
Code:
fdisk - l /dev/hda
before running "resize_reiserfs" (Blocks column).
Wow, thanks for all the help! I'll definately give that a whirl.

Few questions though: I don't have a floppy drive, I assume something similar can be done with a Live CD?

Also, I read the man pages for fdisk but I can't figure out the steps/commands for 5.1 - 5.4. Is there a risk of data loss? Right now other than my main ReiserFS partition and the swap space, the other partitions (the FAT ones) have nothing on them.
 
Old 06-29-2005, 12:06 PM   #10
Steel3
LQ Newbie
 
Registered: Jun 2005
Posts: 10

Original Poster
Rep: Reputation: 0
Code:
root@ubuntu:/home/ubuntu # fdisk -l

Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1       19457   156288321   83  Linux
root@ubuntu:/home/ubuntu # resize_reiserfs -s
root@ubuntu:/home/ubuntu # resize_reiserfs -s 156288321 /dev/hda1
resize_reiserfs 3.6.19 (2003 www.namesys.com)

resize_reiserfs: can't shrink fs; too many blocks already allocated


resize_reiserfs: Resizing failed.
LOL, I am totally lost. I followed the fdisk instructions, but reize failed. Did I just get rid of everything on my system?

EDIT: I probably shouldn't have done this, considering I don't really know what I'm doing, but I figured "what the hell." I seemed to get some result.

Code:
root@ubuntu:/home/ubuntu # resize_reiserfs -s 156288321000 /dev/hda1
resize_reiserfs 3.6.19 (2003 www.namesys.com)

ReiserFS report:
blocksize             4096
block count           38156328 (15635248)
free blocks           23312656 (792263)
bitmap block count    1165 (478)

Syncing..done


resize_reiserfs: Resizing finished successfully.

Last edited by Steel3; 06-29-2005 at 12:38 PM.
 
Old 06-29-2005, 12:35 PM   #11
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
Quote:
I assume something similar can be done with a Live CD?
Yes, you just need to have resize_reiserfs not on a partition you're resizing. If Live CD has resize_reiserfs, then no problem.
Quote:
Is there a risk of data loss?
If you want to expand your first partition, 5.1-5.4 are right.
To keep all data safe after resizing, you should create new partition starting with the same Start cylinder.

When you do
Code:
resize_reiserfs -s 156288321 /dev/hda1
156288321 is in Bytes, not KBytes
Doing the above you could only shrink your partition.
The error message tells you that you have more data in /dev/hda1 than 156288321B (149M), I'm sure you do
All your data are safe, don't worry.

So you should do
Code:
resize_reiserfs -s 156288321K /dev/hda1
~~~Edit~~~
Oops, I'm a bit late with my post
 
Old 06-29-2005, 12:40 PM   #12
Steel3
LQ Newbie
 
Registered: Jun 2005
Posts: 10

Original Poster
Rep: Reputation: 0
I'd initially edited this in the last post, but since it looks like there's another reply, I figure I might as well update it here:

So, umm... that was probably bad judgment on my part, because when I go to boot up my computer, I get something along the lines of "DISK BOOT ERROR. INSERT SYSTEM DISK TO CONTINUE"

Was it a problem in how I resized ReiserFS? I figured since it said it was too small, it was taking the value to resize in bytes, except it wouldn't take 160041885696 bytes so I figured something close would work. Flawless logic, I know :-P

Anyway, am I totally screwed now? Is there some way to recover, like maybe put GRUB on /dev/hda1? Any help would be greatly appreciated. Thanks!
 
Old 06-29-2005, 12:50 PM   #13
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
Code:
160041885696
from my 1st link (who could think I'll quote myself):
Quote:
I insist on using Bytes instead of MBytes, because many programs convert Bytes to MBytes dividing a number by 1000, not by 1024. ntfsresize is one of them. You can see from the above that ntfsresize converts 838860800 Bytes to 839 MBytes. This will lead to misunderstanding in the future.
Well,
Code:
Disk /dev/hda: 160.0 GB, 160041885696 bytes
means that fdisk converted your G into B just the same way.

What distro do you use?
To install GRUB you could boot Install CD and choose "update" option. It should check packages and install bootloader.

Last edited by kornerr; 06-29-2005 at 12:55 PM.
 
Old 06-29-2005, 01:09 PM   #14
Steel3
LQ Newbie
 
Registered: Jun 2005
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by kornerr
Code:
160041885696
from my 1st link (who could think I'll quote myself):

Well,
Code:
Disk /dev/hda: 160.0 GB, 160041885696 bytes
means that fdisk converted your G into B just the same way.

What distro do you use?
To install GRUB you could boot Install CD and choose "update" option. It should check packages and install bootloader.
Okay, so in terms of size, did I do it correctly, or do I need to execute another command to increase it to maximum capacity?

As far as putting GRUB back on is concerned, is that what I need to do in order to boot up my computer again?

I run Ubuntu Hoary (5.04) and from my experience the Install CD tends to screw up partitions, but since I've started mucking around with trying to install Windows I've had to put GRUB back on the computer a few times. I typically follow these instructions (found on another forum):

Quote:
1. Boot from a Live CD, like Ubuntu Live, Knoppix, Mepis, or similar.

2. Open a Terminal. Go SuperUser (that is, type "su"). Enter root passwords as necessary. (in kanotix you need to set the passwd for root yourself...
use
$ passwd root

3. Type "grub" which makes a GRUB prompt appear.

4. Type "find /boot/grub/stage1". You'll get a response like "(hd0)" or in my case "(hd0,3)". Use whatever your computer spits out for the following lines.

5. Type "root (hd0,3)".

6. Type "setup (hd0,3)". This is key. Other instructions say to use "(hd0)", and that's fine if you want to write GRUB to the MBR. If you want to write it to your linux root partition, then you want the number after the comma, such as "(hd0,3)".

7. Type "quit".

8. Restart the system. Remove the bootable CD.
So if that's what I need to do, would I put GRUB on (hd0,0) or the MBR? Do you think that'd be the solution?

In any case, I really appreciate all of the help dude.
 
Old 06-29-2005, 01:27 PM   #15
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
Quote:
did I do it correctly
according to the Edit of post#10, you did all right.
I just wanted to tell that you can't use
Code:
resize_reiserfs -s 160041885696 /dev/hda1
I don't use GRUB, so I don't know anything about it.
But installing bootloader is the last thing for you to do to make you PC boot with Linux.
(I have Ubuntu, but didn't like it... it's just too stripped)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing Mandriva 10.2 Partitioning Problems Anthony1uk Mandriva 3 06-07-2005 06:01 AM
2 Linux, 1 Windows XP and HD partitioning Peit Linux - General 8 12-03-2003 04:52 PM
Installing Linux Without Partitioning Windows Maxinion Slackware 2 10-21-2003 07:56 AM
Partitioning drives to split Linux and windows with windows already on computer. linuxnoub Linux - Hardware 5 10-16-2003 01:21 AM
problems installing linux with windows xp XoTRIBALoX Linux - Newbie 8 09-12-2003 06:43 PM


All times are GMT -5. The time now is 11:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration