CentOS and XP dualboot + ext3/ntfs mount

I have WinXP Pro SP2 on first disk /dev/hda, which my BIOS currently has as first boot device.

I have CentOS-5.2-x86_64 on second disk /dev/hdb, which I can boot into if I set my BIOS to boot from this HDD. It is using LVM with vg00 and a single LV for root (/) filesystem (ext3).

How do I get bootsector file from the CentOS distro so that I can add it into WinXP's boot.ini file? I tried:

dd if=/dev/hdb of=bootsect.lnx bs=512 count=1

and copied the bootsect.lnx file to C:\bootsect.lnx, after which I added the following line to boot.ini in XP:

C:\bootsect.lnx="CentOS 5"

However, when selecting CentOS 5 from NTLDR boot menu, it just hangs with a black screen.

Second question is, how to get:
(a) WinXP to read/write the ext3 filesystem (from the vg00 LV) on /dev/hdb, it currently shows up in WinXP as a RAW drive G:\
(b) CentOS to read/write to and from WinXP's C:\

In the end, I basically want, WinXP's NTLDR to handle booting and I want each OS to be able to read/write to each other.

You copied too many bytes and overwrote the partition table (or part of it). You should copy only 384 bytes in your dd command. Until then, all bets are off. Hopefully you made a backup copy of the boot sector?

Just to clarify, there is no problem with either OS, I can boot into them fine, but I need to tell my BIOS which HDD to boot from.

The problem is the bootsect.lnx file which the NTLDR boots from, which when selected, doesn't boot into CentOS as expected. I will try:

dd if=/dev/hdb of=bootsect.lnx bs=384 count=1

and see if that helps.

Okay, I re-read your post. Normally, I don't use the NTLDR that way. I used a different format and told the NTLDR to boot off the corresponding partition/drive and let the CENTOS boot sector take care of business from there.

I like rehl as 5.0

What @otheus is alluding to IS that the boot loader that comes with modern Redhat(& others) is GRUB & it detects the presence of a windows partition & creating a boot menu entry for it.

Which is why *most* implementations install XP first then Linux. I've used your method many moons ago which worked for me, then GRUB came along
(ps. don't uprade\install vista on the same HD as linux, vista can't co-exist)

----------
ms. stevi

Actually, I was alluding to the fact that (1)

C:\bootsect.lnx="CentOS 5"

is NOT a valid NTLOADER line from what I have seen. And further (2), NTLOADER doesn't directly load Linux: grub loads linux. What NTLOADER can do (I Think) is to load the boot sector as if the BIOS had just loaded a boot sector, and in that case, the boot sector would contain the boot-strap code that GRUB uses.

But Stevie Velvet is probably correct: easier to use Grub to load windows, perhaps, than the other way around.

Unix is so frustrating. OK, here's what I mean. I have almost two days of experience here, but every post I've seen so far says to copy 512 bytes. But what's really frustrating me is that in hours of searching the net all I'm finding is questions, and actually some nice suggestions, but nothing is ever completed.

I have no idea what GRUB is or why I should have to install it. Or even how to install it. What does sdb mean? What does hdb2 mean?

CentOS did not find Windows on my system, possibly because I'm installing CentOS on a different drive. I don't understand why I cannot use boot.ini on the first HDD (C: if I may call it that) to direct the hardware to go to the second HDD (E: if I may call it that) and boot from there.

But all I get is a blank screen. What can I do to solve the problem in this way, so that I can use boot.ini to present the OS options, select the one I want, and then boot to C: (XP) or E: (CentOS) as desired?

This is my boot.ini file and I have created boot.lnx and stuck it at C: - I don't understand why it doesn't work, unless perhaps the last line needs to start with multi(0)disk(0)rdisk(1)partition(1)\ ?

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="XP" /noexecute=optin /fastdetect
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="XP with no Crappy Crap" /safeboot:minimal /sos /bootlog
C:\CMDCONS\BOOTSECT.DAT="XP with Recovery Crap (Run batch set.txt!)" /cmdcons
C:\boot.lnx="CentOS 5.3 on External Sata Drive Connected via USB"

:confused:

It's actually 440, but 512 won't hurt in this case. You copy those bytes from the boot disk that you careated through the CentOS process, right?? Then you copied them to the file boot.lnx on C:, right? Still, I doubt this will work because your drive is on USB, and the USB disks are not mapped to device names until later in the boot process. Note: I've never tried booting off USB before.

I didn't create a boot disk, if you mean floppy. I installed CentOS to a second hard disk drive. I then created the boot.lnx file with

dd if=/dev/sdb1...

which didn't work so I then tried

dd if=/dev/VolGroup00/LogVol00...

which also didn't work. The df command revealed both. In both cases I get nothing. When, however, I try to boot directly to the drive using F9 to select the POST boot menu, then at least I get "Missing OS."

Yes, in both cases, I copied the file to C:\. But if the problem is that it's a USB drive, I guess I can fix that by connecting the drive directly. The only reason I have it as a USB drive is that it's a misc. drive I just had sitting around and I connected it with a universal drive adapter to "just see."

I do not know the difference between /dev/sdb1 and /dev/VolGroup00/LogVol00 - when I did a df they both appeared so I thought I would try both. Possibly one is the HDD with Windows on it, I don't know. All these cryptic abbrevs., I don't know what they mean because I'm used to drive letters and a command prompt that tells me where I am in the file system.

==================================

Update - connecting the drive via SATA instead of USB did the trick. I formatted, connected via SATA, installed, and went from there.

the linux.bin file to create, it turns out, was the one from /dev/sdb1..., not /dev/VolGroup00/LogVol00.... I'm not sure if it made a difference because, just as with balancing my checkbook, once you get things working, STOP THERE.

Now, if I only knew how to unload Gnome so I could try KBE, and how to see a context-sensitive prompt, and how to get an underscore cursor instead of a block cursor, and how to get terminal output in white instead of dark blue (on black), and..., and..., and..., and.... Um, well thanks for listening.

Interesting trick ... connect it via SATA vs. USB. I suppose you have a chassis which allows for both.

In a morning-shower epiphany, I was going to suggest connecting your linux drive ONLY when you want to boot into it, and to tell the BIOS to boot off USB before booting off the IDE interface. You got this to work fine, but I add that tip for future comers.

Nah - what I had was an NewerTech� Products universal drive adapter. I could've stuffed the whole kit-n-kaboodle inside the box, but I already have one floppy drive.... {runs away from the screaming mob....}

Svan,

Perhaps Linux is not for you. If you don't want to learn something new, why are you using something you are unfamiliar with? Linux and UNIX are not "Windows but free" they are different tools with different paradigms for doing things.

GRUB is a boot loader and a more effective and powerful one than ntldr is. You CAN boot with ntldr for your needs and here's a link on how:

Tubidy - MP3 Music MP4 Video Downloads Free High Quality (edit for a better link, the one below is not the one I thought it was)

Cool Solutions: Configuring Dual Boot (SUSE Linux, Windows) Systems

You may have to make adjustments as this is for SUSE and you are using Red Hat or a clone of it.

However, you can install grub (and it is recommended that you do so). I would recommend you load it on your first drive and use it to boot both operating systems instead of trying to make Windows, already unfriendly to other systems, boot Linux for you.

As well, you should understand that C: and D: and such are Windows/Dos constructs. In linux, you have no "drives" per se, they are all files. Everything is considered a file in *Nix. Thus, your disk drives are /dev/sda (for serial drive a, including SCSI and SATA/SAS drives). /dev/hda and hdb and hdc and such are PATA/IDE drives. The number after them, when in the OS (Not the boot loader, GRUB) are the partition.

Each drive can contain 4 primary partitions at most, or, you can form the last primary partition into an extended partition, "using up" the last primary partition to create a space to create extended partitions. This way you can usually have ~16 partitions per drive.

This way, /dev/sda is the drive and /dev/sda1 is the first partition (primary)
/dev/sda2 and /dev/sda3 are the 2nd and third partitions. /dev/sda4 would be the last primary, but it is usually not allocated that way and instead becomes a container for extended partitions and you would go directly to /dev/sda5 and so forth.

After you partition, and you should learn about how to do that and why, you need to create a file system (Windows usually has 2-3 options of FAT, FAT32 and NTFS, though a few others are not often used), however Linux can use multiple ones including FAT/VFAT(Fat32 implemented on Linux) and Ext2/3/4, ReiserFS (dead, no pun intended), XFS, JFS, etc etc. They have merits to them all.

Again, if you choose to learn about this, you will have a more pleasant experience using the operating system than if you just choose to butt heads with it and complain about it.

Who said I didn't want to learn something new? What I was complaining about was not the OS but the fact that internet resources about *nix assume a level of sophistication few newbies have. I don't have any complaints about the OS's paradigm but about the instructions I'm finding on the net. Your message is the first one I've seen that explains what sda means, for example. Another example - a four paragraph description of PROMPT_COMMAND that says virtually nothing about it at all.

As a technical writer, I perhaps judge too harshly, especially in terms of people who were kind enough to share their own experiences, and I recognize that. But certainly I'm allowed to blow off steam when I see the same question posted in many places and no real answers.

All I ask is understanding that some of us - especially at first - need to be told, "Approach the light. If it is red, stop before the stop bar. If it is green, proceed through. If it turns yellow while you can still stop safely, then stop. If it turns yellow but you've already crossed the stop bar, or you cannot stop safely, proceed through with caution and watch in your mirror in case the policeman disagrees with your decision. Do not in any case make contact with anything other than the road...."

We were all new once. At work, I am the person who must constantly respond to, "Help, my computer did something," in response to which I try to help my users help themselves. I'm not afraid to learn, or to teach, but, like everyone, I get frustrated too, especially when stuff happens contrary to documentation (like my version of bash seeing no difference between PS1=\W and PS1=\w).

The good news is that I'm now 150 pages further along in Linux for Dummies and - hopefully - getting a little less stoopid all the time.

Thank to everyone for the explanations - they were quite helpful and I am happily booting CentOS using Window's boot.ini to present the OS choices.

---------- Post updated at 05:26 PM ---------- Previous update was at 05:21 PM ----------

Do I have to boot via the CentOS Live CD in order to copy those bytes? Or can I just run dd from a bash prompt while using the system itself?

Yes.

That's because anyone not using a stand-alone or live-cd Linux installation must have a level of sophistication newbies don't have.

Even to install a multi-boot OS is beyond the sophistication of 99% of all Windows users and 50% of all Linux users.

Svan,

My comment was not an attack on you or whether you particularly wanted to use Linux. However, you are not the first person who has come up with questions, got frustrated and then started to get annoyed with the situation. It is understandable, but in many cases, it ends up becoming a flame war of opinions.

There's nothing wrong with saying "Look, I thought I could do XYZ, I can't, so I am not going to stick it out." Each person has their own threshold for grief, and yes, changing operating systems can be grief. While I think that *Nix has a better way of doing things, if you don't know that way it makes a simple task difficult.

As you are a technical writer, I would recommend that instead of getting a "For Dummies" book, which will probably teach you just enough to get to a point before you want to be, take a look at RUTE's guide:
<redacted>

It will expand in most browsers and give you a good reference for starting out, though, please realize, it is dated and some information may be old and less useful or even wrong, the basics should be there.

I have had many conversations from people who have been using Windows or another OS for many years, and I myself started that way, and was even a Windows System Admin for several years before really understanding how Unix/Linux can be a more powerful tool. Before Power Shell (still know few people who use it on Windows) there was really only cmd/dos prompt syntax for doing things.

Now, when I was creating users for my network (don't ask, they demand islands of isolation so no central system) I did the following:

for i in <system1> <system2> <system3> <system4>
do
ssh $i "useradd -u <userid> <groupid> <secondary groupid> -m -k /etc/skel -d <home directory> -s <shell> -c <comment> <user>"
done

where the items in the <>s were the info. That made my user on 4 systems without having to do it 4 times

There's a lot of power there and Linux can be VERY user friendly, just not intuitive. Once you understand it, its like the handcuffs come off and you are way more powerful at doing the same jobs.

I think the biggest question I have so far is how to know what to install based on the system I have. For example, usermod -G admin Bob won't work on CentOS 5.3 and returns an invalid numeric argument error. So I guess what I need to do is to update shadow-utils. When I google that for RPM packages, one website returns seven pages of links, with about, oh, 10 relative to CentOS and several for RedHat too. This is not perhaps the best example because this page does refer to CentOS 5.3, but in general how do I figure out "what to get" for an application or upgrade package based on "what I have"? We're not in XP Pro anymore and I don't want to go looking for falling houses to stand under....

what are you trying to do with usermod? If you are trying to make Bob part of the admin group you have it backwards

Also, your usernames should, for conventional sake, be lowercase

Also, usermod -G will change the secondary group, so the GID (Group Identifier) for the user never changes.

If you run the "id" command on your user you will see the UID, GID and the groups they are a member of.

As for CentOS you can use yum, the built in downloader/software manager to handle most of what you need. Also look at pirut for doing most of what you want with the packages. It should be installed.

Think of the way Linux distributions manage software now as packages of information that rely on other packages of information. They now use repositories, kind of like a personal "Amazon.com" if you will. Say you want to install xyzfoo.rpm you can do that with yum on CentOS 5 and if xyzfoo.rpm needs abcdoodad.rpm it will grab both, download them, install them and update its own library to show that they are both there.

Bob was just an example but I was following Robhogg's instructions at User not in the sudoers file - LinuxQuestions.org .

The goal was to be able to run sudo. CentOS didn't create an admin group or any admin users (i.e., me) on first install but I'm beyond that problem now having created the group manually and then given it root permissions.

Back to the installer - Isn't what the Add/Remove Software GUI shows me simply the packages that came with the CD download? Or is it looking at the internet to determine what's available? What if I want a program which isn't in the Add/Remove Software GUI though? How do I know which one is right?

I'm closing this thread. Sven, if you have a new question, feel free to start a new thread.