LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cannot run CP command! (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-run-cp-command-323127/)

hrudolph 05-13-2005 10:21 AM

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

jeffreybluml 05-13-2005 11:05 AM

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,

hrudolph 05-13-2005 11:17 AM

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

jeffreybluml 05-13-2005 11:38 AM

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,

jschiwal 05-13-2005 12:09 PM

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.

hrudolph 05-14-2005 03:33 AM

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!

jeffreybluml 05-14-2005 07:58 AM

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.

hrudolph 05-14-2005 11:41 AM

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.

jeffreybluml 05-14-2005 12:24 PM

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,

hrudolph 05-14-2005 12:51 PM

Hate to be a noob, but whats root?

jeffreybluml 05-14-2005 01:12 PM

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,

jschiwal 05-14-2005 10:38 PM

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

jeffreybluml 05-14-2005 10:52 PM

Hey cool man, I never knew about that!

Thanks for the tip!!


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