LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 01-10-2004, 05:26 AM   #1
polyspaston
LQ Newbie
 
Registered: Jan 2004
Posts: 3

Rep: Reputation: 0
Using bash to copy files from the CD-ROM


I bought a Dell Inspiron 1100 specifically for trying out Linux, which I now regret even though it was very cheap, downloaded the Debain installer and created an install CD. I'm selecting 'sarge' and installation seems to do it's stuff properly using the ftp - auto configures the LAN connection and internet.

I gave up trying to partition the disc etc, I'm now devoting the entire harddisk to Debian and selecting only the base desktop install, auto-partition option selected during the installation process - it creates a large Linux partition and a small swap partition.

My problem is that the X server interface will not start, it says:
Fatal Server Error:
no screens found
XIO: fatal IO error 104 (Connection reset by peer) on X Server ":0.0"
after 0 requests (0 known processed) with 0 event remaining

I've found lots of great stuff from other Insp 1100 users about screen setup, bottom line is that it seems I need to install a patch (845patch.tar.gz) because Linux can't tell the BIOS (A20) to use more than 1MB of video RAM. The 1100 has a wierd video setup, it uses RAM or video throught the i810 driver. I've downloaded the patch on another machine and placed on a CD. But the X Server GUI will not start without the patch, even when I install with 640x480 colour depth 1 bit etc, it defaults back to a bash command line.

My question is how do I get the patch onto my hard disc using bash? I've done following under the root login:

localhost:/# mount /dev/cdrom /sbin

the cd fires up and I get the following screen msgs:
Attached scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0
sr0: scsi3-mmc drive: 8x/8x writer cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.12
mount: block device /dev/cdrom is write-protected, mounting read-only

What I want then to do is somthing like:
localhost:/# cd /sbin/ - this is where I want the file to go
localhost:/sbin# cp /dev/cdrom/845patch.tar.gz /sbin/845patch.tar.gz

I get the scren message:
cp: cannot stat '/dev/cdrom/845patch.tar.gz': Not a directory

I've also tried:
localhost:/sbin# dir /dev/cdrom

the cd-rom does not fire up and I get:
/dev/cdrom

Any help would be most welcome, thanks.
 
Old 01-10-2004, 05:55 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You are entering '/dev/cdrom' instead of the mounted location, probably /mnt/cdrom.
 
Old 01-10-2004, 10:12 AM   #3
dishawjp
Member
 
Registered: Dec 2003
Location: Central New York
Distribution: RH/Fedora/SUSE
Posts: 64

Rep: Reputation: 15
Your problem is in your mount command. It should have been "mount /dev/cdrom /mnt/cdrom" not "mount /dev/cdrom /sbin"

Then you would have been able to copy your .tar.gz file from /mnt/cdrom to /sbin. I really don't recommend copying .tar files directly to your /sbin directory though. Uncompressing and untarring a .tar.gz file will create a directory with several files and possibly a directory structure in it. I have created special directories in my /home/user directory to handle and store these types of files. For .tar types of files I have a /home/user/download/tars directory. You can then cd to that directory and untar/unzip the file, cd to the directory it creates, and after reading teh generally included README and INSTALL files do what is required. Generally this is either a ./configure make make install or some variation of that or it may just be copying a file or files to some appropriate destination on your computer.

Good luck and hope this helps.

Jim Dishaw
 
Old 01-10-2004, 12:51 PM   #4
polyspaston
LQ Newbie
 
Registered: Jan 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for your help Jim.

What has worked for me is slightly different as follows:
under the root login:
localhost:/# mount /dev/cdrom /mnt
(when I tried your command it said /mnt/cdrom didn't exist - which is no surprise I guess cuz it doesn't)
localhost:/# cp /mnt/845patch.tar.gz /home/marker/845patch.tar.gz

I took your advice about the sbin dir...

A final question, how do you stop bash from scrolling, e.g. when listing a v. long directory to press enter at each page?

Last edited by polyspaston; 01-10-2004 at 12:52 PM.
 
Old 01-10-2004, 02:27 PM   #5
JayCnrs
Member
 
Registered: Mar 2003
Location: Winnipeg
Distribution: Suse 9.3 Pro
Posts: 404

Rep: Reputation: 30
You could use the command:

ls /path/directory | less

Then hit the space bar to scroll page by page, once your are done hit the q.
 
Old 01-10-2004, 09:28 PM   #6
dishawjp
Member
 
Registered: Dec 2003
Location: Central New York
Distribution: RH/Fedora/SUSE
Posts: 64

Rep: Reputation: 15
Hi,

Glad I was able to help.

The command "ls | less" will work as was suggested, but so does "ls | more" The "more" command is used by several operating systems, DOS, Linux and OpenVMS, to name three and since I have to work in all of those and am not very smart, I use that command instead of the newer "less" command. To scroll down one page, use the spacebar; to scroll down one line, use the enter key; to go up one page, use the "b" key; and to quit, use the "q" key. Not much different from the "less command, no more letters to type, and more portable. Another way to do it is to save the directory listing to a file... something like "ls > nnn" which will create a file named "nnn" which will contain the listing of the entire driectory. You could then open the file with your favorite text editor with a command like "vi nnn" or "gedit nnn" or whatever and poke around and see what's there. Or, if you're looking for something specific you could always then "grep string nnn" substituting what you're looking for for the word string. Or maybe "wc nnn" and use the thrid number to find out how many entries there are in the directory. Anyway when done playing with the file nnn, just delete it with "rm nnn"

Lastly, to add a mountpoint such as cdrom to your /mnt directory, just "su" to root and:

# cd /mnt
# mkdir cdrom

And you're done.

Linux is fun and gives you lots of different ways to do about anything you want.

Enjoy!

Jim Dishaw
 
Old 01-13-2004, 09:06 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Here is the line I was refering to:
What I want then to do is somthing like:
localhost:/# cd /sbin/ - this is where I want the file to go
localhost:/sbin# cp /dev/cdrom/845patch.tar.gz /sbin/845patch.tar.gz

If you first mount the cdrom to /mnt then
cp /mnt/845patch.tar.gz /<destination-dir>/

Apparently a debian system is different. I'm used to Mandrake linux and other file systems are mounted under the /mnt directory including the cdrom.
 
  


Reply



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
copy from cd-rom just read-only Boby Linux - Software 1 09-07-2005 07:04 PM
making .tif files into animated .gif files (bash shell, Red Hat 7.2) illiniguy3043 Linux - Newbie 1 06-01-2004 04:04 PM
how to copy and paste between text editors sessions in bash pxes351 Linux - Newbie 2 05-06-2004 06:59 AM
cd-rom IO copy error killjoyce Linux - Hardware 0 01-28-2004 12:11 PM
how to copy and paste between files and within files Bheki Linux - General 1 02-05-2002 05:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:01 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
Open Source Consulting | Domain Registration