LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-13-2005, 11:21 AM   #1
hrudolph
LQ Newbie
 
Registered: May 2005
Posts: 5

Rep: Reputation: 0
Cannot run CP command!


Wow, this has been a long 2 days!

I have a 2.1 ghz athalon with 512 ram, and 160 gig hd, I partitioned 40 gigs of the HD and installed linux Fedora Core 3 on it. Unfortunatly from what I read I need to transfer a file called hda3 to my c drive in order to run my default windows boot loader.

I plugged in my rescue disk and started up. After going through a serious of prompts I got to the terminal. I mounted my DOS formatted disk by typing mount "-t msdos /dev/fd0 /mnt", then I typed "dd if=/dev/hda3 of=/linux.bin bs=512 count=1", so far so good. Next I typd in cp /linux.bin /mnt, this is where the computer told me it did not recognize that command!

-I have been trying at this for hours and hours and cannot get it to run right. Any ideas?

--Hannes Rudolph
780-887-4732
 
Old 05-13-2005, 12:05 PM   #2
jeffreybluml
Member
 
Registered: Mar 2004
Location: Minnesota
Distribution: Fedora Core 1, Mandrake 10
Posts: 405

Rep: Reputation: 30
Hmmm, I'm not sure what you mena by transferring a "file" called hda3. hda3 is how linux refers to your hard drive, in this case the first one connected (the "a" in hda3) and the third partition on it (the "3").

I don't think you want your windows bootloader to run. You just need to tell grub or lilo (linux bootloaders) wehre the windows OS os so that it can boot it IF YOU CHOOSE at boot-time.

Do you konw if you installed grub or lilo?

Search the forum for "dual boot" and find instruction on how to edit your grub.conf or lilo.conf files (assuming you have one installed) to tell them where to find the windows partition. THen when you boot, you should get a menu with linux and windows in it...

What happens if you boot without a rescue disk?

Oh, and as far as the cp command, perhaps the resuce disk does not have it on there? I guess you could try, as root, this:

locate cp | grep bin

and that will give you the location of it if it's in one of the many bin directories...which it should be...

Good luck,
 
Old 05-13-2005, 12:17 PM   #3
hrudolph
LQ Newbie
 
Registered: May 2005
Posts: 5

Original Poster
Rep: Reputation: 0
I was trying to do the following


Keeping the XP Boot loader requires a bit of finagling.

First, you install Linux. Then, when booted INTO Linux you insert a DOS formatted floppy into the drive, and open a console. In the console, you type
mount -t msdos /dev/fd0 /mnt/floppy
dd if=/dev/hda of=/linux.bin bs=512 count=1


This copies the first 512 bytes of the MBR, where Linux has stored the bootloader, to a file called linux.bin, located in the root directory. (if your hard drive is other than primary master, adjust /dev/hda accordingly)

Now, in console again, cp /linux.bin /mnt/floppy. This copies the bootloader stuff to a floppy, for use in a bit.

Un mount the floppy with;
umount /mnt/floppy

Remove the floppy, since it isn't bootable, and boot back into WinDoze. Insert the floppy, then copy the linux.bin to the root of your WinDoze drive (copy a:linux.bin c:\).

Now, edit the boot.ini file. In WinDoze, this file may be hidden.
You can unhide it by clicking on Tools=>FolderOptions, and turn off the 'Hide system files' option in Explorer, or you can access it via the Control Panel's System tool ([right-click]MyComputer=>Properties=>Advanced), or via the msconfig program, in the 'boot.ini' tab.

Add this line to boot.ini:
C:\linux.bin = "Linux"


I have Grub, how do I edit the conf file?

Hannes Rudolph
 
Old 05-13-2005, 12:38 PM   #4
jeffreybluml
Member
 
Registered: Mar 2004
Location: Minnesota
Distribution: Fedora Core 1, Mandrake 10
Posts: 405

Rep: Reputation: 30
Wow, I've never seen that before. I honestly don't see why it's necessary; the linux bootloaders are best anyways.

You can find/edit grub at /boot/grub/grub.conf - usually. If it's not there, it'll be somewhere in the /boot directory. I haven't used Fedora Core 3 yet...

you'll need to be root to edit it. Add this to the end...

title Windows
rootnoverify(hd0,0)
chainloader +1

##EDIT: read the thread below and make sure there is any entry in grub.conf for your fedora install as well...##

and then do this from the terminal

grub-install /dev/hda

That should install grub on the MBR, over the windows bootloader. Now reboot, and you shold get the menu showing both windows and linux.

Here's a god thread for reference, though there are about 2 million of the same threads here on the forum...

http://www.linuxquestions.org/questi...hreadid=318083

Good luck,

Last edited by jeffreybluml; 05-13-2005 at 12:39 PM.
 
Old 05-13-2005, 01:09 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
For your original instructions, you needed to copy the linux.bin program to the floppy.
After mounting the floppy, cp /linux.bin /mnt/floppy/ (assuming that is where your floppy is mounted. Then unmount the floppy. Boot into windows. Copy the file to the c:\ directory: copy a:\linux.bin c:\

Next you have to change the permissions of the c:\boot.ini file before you can edit it. Using the "attrib" command, turn off the system attribute and make the file readable. Then "edit c:\boot.ini" and add the line that the instructions use. After saving your changes, restore the system and hidden attributes and reboot.
 
Old 05-14-2005, 04:33 AM   #6
hrudolph
LQ Newbie
 
Registered: May 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Yes I know that, but I cannot copy the linux.bin onto a disk, the cp command does not work. That is my only problem!
 
Old 05-14-2005, 08:58 AM   #7
jeffreybluml
Member
 
Registered: Mar 2004
Location: Minnesota
Distribution: Fedora Core 1, Mandrake 10
Posts: 405

Rep: Reputation: 30
did you do a

locate cp

or

locate cp | grep bin

yet? If those don't find it, do an

updatedb

and then try again. There has to be a copy command somewhere!!

Good luck.
 
Old 05-14-2005, 12:41 PM   #8
hrudolph
LQ Newbie
 
Registered: May 2005
Posts: 5

Original Poster
Rep: Reputation: 0
I figured it out! Since hda1 2 and 3 are all partitions on hda0 when I was setting up my linux boot loader to run I was selecting windows to run from hda1 but I never realized that it was the partition for my compaq system restore. So each time I would start up windows in my linux boot loader it would want to run a restore! When setting up my linux boot loader this time I added a 3rd partition to the choices and pointed it to hd2 and now when I start up I can access my restore, linux, or xp home.

I cannot belive that took me 10 hours of thinking to fix when I figured it out while I was away from the computer!

Now my next problem lies in setting up Project Looking Glass and I have no idea how to use linux. Obvously there are many common sense things I figure out that I learned from useing macos 7 up to X, and running windows 95 to xp. But there are still some differences that catch me once and a while. I have a file called jai-1_1_2-lib-linux-i586-jdk.bin and it does not want to open in linux. Do I need a program to run it? and when I go to http://java.sun.com/j2se/1.5.0/download.jsp I am not sure which file is the "Java 2 SDK, Standard Edition 1.5.0 or later." I am supposed to be downloading.

Thanks for all your help.
 
Old 05-14-2005, 01:24 PM   #9
jeffreybluml
Member
 
Registered: Mar 2004
Location: Minnesota
Distribution: Fedora Core 1, Mandrake 10
Posts: 405

Rep: Reputation: 30
Bin files are executed by first making them executable with this command, as root

chmod a+x jai-1_1_2-lib-linux-i586-jdk.bin

and then you run it with this command, typed from the directory containing the files...

./jai-1_1_2-lib-linux-i586-jdk.bin

or

sh jai-1_1_2-lib-linux-i586-jdk.bin

Good luck,
 
Old 05-14-2005, 01:51 PM   #10
hrudolph
LQ Newbie
 
Registered: May 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Hate to be a noob, but whats root?
 
Old 05-14-2005, 02:12 PM   #11
jeffreybluml
Member
 
Registered: Mar 2004
Location: Minnesota
Distribution: Fedora Core 1, Mandrake 10
Posts: 405

Rep: Reputation: 30
Oh, sorry, didn't mean to get ahead of you there...

root is the main administrator of a linux system, the super-user who can do all. When a system is set up, you should have been asked to set a root password. Hopefully you remember this...

To become root indefinately, type

su

hit enter, and it will ask for the password. Type it, hit enter, and the user name at the beginning of your terminal prompt will now say root. You don't want ot be root unless you have to though, cuz you can totaly screw up your system with a typo or hastily run command. So, you can run a command once as root, by using sudo. I think this stands for Substitute User, Do Once.

Let's say you wanted to run the file test.bin as root. While in the directory containing the file, you'd type

sudo ./test/bin

It will prompt you for a password, enter it, and it will run the command as root and not keep you logged in as root...

Good luck,
 
Old 05-14-2005, 11:38 PM   #12
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
If you have a question about what a file is, use the "file" command. It will look at the file, and tell you what kind of file it is.
file /jai-1_1_2-lib-linux-i586-jdk.bin
 
Old 05-14-2005, 11:52 PM   #13
jeffreybluml
Member
 
Registered: Mar 2004
Location: Minnesota
Distribution: Fedora Core 1, Mandrake 10
Posts: 405

Rep: Reputation: 30
Hey cool man, I never knew about that!

Thanks for the tip!!
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command to run another command against a list of files psweetma Linux - General 3 11-09-2005 06:29 PM
Run a command from anywhere ToothlessRebel Linux - Newbie 4 03-05-2005 02:36 AM
How to run a command Maintech Mandriva 1 11-20-2004 10:41 PM
the command for run command devfreak Linux - Software 4 06-08-2004 11:24 AM
Run Command csosa Linux - Software 1 09-27-2003 11:41 AM


All times are GMT -5. The time now is 10:54 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration