LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 04-30-2007, 03:52 AM   #1
zantac
LQ Newbie
 
Registered: Sep 2006
Posts: 5

Rep: Reputation: 0
how to make the cdrom executeable ?


My problem is that my cdrom only mounts read-only. This is a problem since I want to run a install-script on the cd.
How can I make the script executeable ?

/Tobias

mount: block device /dev/cdrom is write-protected, mounting read-only
dvorac@dvorac:~$ cd /cdrom
dvorac@dvorac:/cdrom$ ls
00000000.016 00000001.TMP InstallForMacOSX.app setup.exe win32 00000000.256 autorun.inf install_unix.sh unix
dvorac@dvorac:/cdrom$ sudo ./install_unix.sh
sudo: unable to execute ./install_unix.sh: Permission denied
 
Old 04-30-2007, 03:54 AM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
not familiar with sudo, but 'sudo sh ./install_unix.sh' should do - CD-ROMs are kind of necessarily read-only.
 
Old 05-03-2007, 05:02 AM   #3
zantac
LQ Newbie
 
Registered: Sep 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Sure, of course CDROMS is read-only. But it would be possible to run the script I think.
No one got a clue ?
 
Old 05-03-2007, 07:16 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Two questions:
1] Is the script executable?
2] Is the CDROM mounted with the noexec option?
 
Old 05-03-2007, 08:08 AM   #5
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Why not just copy the contents of the CD to a temporary directory and run it from there? Once it's on your hard drive, you can do what you like with the permissions.

Check the noexec option on the mount command first though.
 
Old 05-03-2007, 08:37 AM   #6
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Quote:
but 'sudo sh ./install_unix.sh' should do
Code:
[root@lightsaber /root]# mount -o noexec,ro /dev/hda8 /mnt/hda8/

[ j@lightsaber ][ 05-03 09:33 ][ ~ ]
:mount | grep hda8
/dev/hda8 on /mnt/hda8 type reiserfs (ro,noexec)

[ j@lightsaber ][ 05-03 09:33 ][ ~ ]
:/mnt/hda8/home/j/system/sbin/ce foo
bash: /mnt/hda8/home/j/system/sbin/ce: /bin/sh: bad interpreter: Permission denied

[ j@lightsaber ][ 05-03 09:34 ][ ~ ]
:sh /mnt/hda8/home/j/system/sbin/ce foo

[ j@lightsaber ][ 05-03 09:34 ][ ~ ]
:echo $?
0

[root@lightsaber /root]# umount /mnt/hda8/
[root@lightsaber /root]# mount -o noexec /dev/hda8 /mnt/hda8/
[root@lightsaber /root]# chmod 600 /mnt/hda8/home/j/system/sbin/ce

[ j@lightsaber ][ 05-03 09:34 ][ ~ ]
:/mnt/hda8/home/j/system/sbin/ce foo
bash: /mnt/hda8/home/j/system/sbin/ce: Permission denied

[ j@lightsaber ][ 05-03 09:36 ][ ~ ]
:sh /mnt/hda8/home/j/system/sbin/ce foo

[ j@lightsaber ][ 05-03 09:36 ][ ~ ]
:echo $?
0
 
Old 05-03-2007, 09:26 AM   #7
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
but sudo sh ./install_unix.sh should do
Neat. Thank you.
And you've shown that it doesn't matter about the noexec option (or even if the script is not marked as executable - I just tried it myself).

So, did you try this zantac?
 
Old 05-03-2007, 11:54 AM   #8
zantac
LQ Newbie
 
Registered: Sep 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for the response!
I solved the issue by adding the exec option in fstab. By some reason the device was mounted as noexec even without the noexec option in fstab.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make a virtual image of a cdrom and search/to go into it ? Xeratul Linux - General 3 12-11-2006 01:19 PM
How to make bootable CDROM to format a raw disk? Barzan Linux - Software 1 08-19-2004 06:22 AM
how to make a linux distro cdrom behmjose Linux - General 1 04-25-2004 03:09 AM
k3b howto make booteable cdrom??? Schmurff Linux - Software 4 03-15-2004 09:27 AM
How do you make it so that the CDRom/Floppy Icons don't appear on the desktop? hitesh_linux Linux - General 10 02-28-2004 04:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 06:57 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