LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Hard drive Permissions issue (https://www.linuxquestions.org/questions/linux-newbie-8/hard-drive-permissions-issue-801772/)

Megabitfl 04-13-2010 11:47 AM

Hard drive Permissions issue
 
Hi all,
we are using an application on a 'Live CD' which is doing some of what we need but we want to add additional applications to it. I moved it to a hard drive and tested that it worked properly, then I put that hard drive in an existing Debian 5 pc as the second hard drive. The problem is that the hard drive thinks it's a CD and is read only.
On my development system I have 1 Debian hard drive , the test hard drive drive and 1 floppy, no CDrom.

The fstab shows:
# <filesystem> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0

/dev/hda1 - normal mount (ext3)
/dev/hda5 - normal mount (swap)

/dev/hdc /media/cdrom0 UDF,iso9660 user, noauto 0 0

/dev/fd0 - normal mount

So, how can I make the hard drive hdc stop thinking it's a cdrom so I can add the additional applications?

Any help would be appreciated.

Megabit in FL

tommcd 04-13-2010 12:22 PM

Quote:

Originally Posted by Megabitfl (Post 3934217)
Hi all,
we are using an application on a 'Live CD' which is doing some of what we need but we want to add additional applications to it. I moved it to a hard drive and tested that it worked properly, then I put that hard drive in an existing Debian 5 pc as the second hard drive. The problem is that the hard drive thinks it's a CD and is read only.

What application is this that you are using? Is it something you wrote yourself? Or is it something you got off the internet or the Debian repos? If the app is publicly available, could you provide a link to it?
And how did you copy this application to the second hard drive?

So what is on this second hard drive? Just this one application and nothing else on the entire hard drive? Is there any data on it or anything?
I don't think I have ever seen a hard drive mounted as a cdrom drive before. Is this an internal or external hard drive connected via a usb cable?
Here is the fstab entry for my data drive (my second hard drive) on my Slackware system:
Code:

/dev/sdb5        /data            ext3        defaults,noatime        1  2
Something like that would be what you would expect for a second hard drive on a linux system.
(Note: Normally, a second hard drive on a linux system would /dev/hdb, or /dev/sdb. /dev/hdc would be used for the third hard drive, etc.
Note #2: Just in case you are wondering, the reason my data drive has only the logical partition /dev/sdb5 in my fstab is because /dev/sdb1 is a primary partition that I just do not have set to automount on my system. If I did want to automount it, I would just add:
Code:

/dev/sdb1        /data            ext3        defaults,noatime        1  2
to my fstab. Or if I formatted it to ext4, I would just change the ext3 to ext4 in fstab.
Hope this helps.

And welcome to the LQ forums!

camorri 04-13-2010 12:32 PM

A second hard drive will be hdb, not hdc. hdc is your cdrom. fstab is not automatically updated if you add a disk. You have to edit the /etc/fstab file and add what you want.

Run the command 'df' wihtout quotes in a terminal, and it should show up there, once the partition(s) are mounted.

The command that mounts the second drive partitions controls it the partitions are read only or read/write.

To mount a new partition, on a second IDE hard drive, first make a mount point. A mount point is nothing but an empty directory. Pick a standard location such as /mnt. As root, in a konsole, cd /mnt then, 'mkdir newdrive'. That will create an empty directory at /mnt/newdrive. Now issue a mount command. 'mount -t filesystem_type /dev/hdb1 /mnt/newdrive' should do it. ( You have to change the word filesystem_type to the type of file system you have. See man mount for all supported file systems.

If you get no output from the mount, it worked. Navigate to /mnt/newdrive and do a 'ls' to show your files...

tommcd 04-13-2010 01:33 PM

Quote:

Originally Posted by camorri (Post 3934265)
A second hard drive will be hdb, not hdc. hdc is your cdrom. fstab is not automatically updated if you add a disk. You have to edit the /etc/fstab file and add what you want.

This is what I thought also. But consider that in his first post Megabitfl (the OP) stated that:
Quote:

On my development system I have 1 Debian hard drive , the test hard drive drive and 1 floppy, no CDrom.
Megabitfl,
Just to clear this up, the system that you are asking about, the system that runs Debian 5 with the 2 hard drives, does it or does it not contain a cdrom drive?
I thought that your system was without a cdrom from your first post. But you obviously are using 2 systems here. Am I correct?
The first system ran the "liveCD" and the second system contains the second hard drive in question that you want add to your fstab. And this system is without a cdrom drive. Am I correct so far?
Sorry if I sound overly anal here. I just want to make sure everyone knows what you are working with so we can give you the best possible advice.

Megabitfl 04-13-2010 02:26 PM

Folks,
Thanks for the ideas but they don't work yet. Here is a bit of back ground.

The application is GNU GPL compliant (?), it was given to me as an img.gz on a flash drive. I had an unused pc with a 60 gig hd in it so I booted from a Linux Boot CD then #gunzip -c application.img.gz > /dev/hda. This put the image on the hard drive and rewrote the partitions, hda1, hda2, and hda3.

I then removed the hard drive and put it into my Debian 5 pc as the second hard drive. My thoughts were I would have root permission. I disconnected the cdrom so it wouldn't be a factor. Now I boot Debian and the /etc/fstab is as follows:

# <filesystem> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda1 / ext3 errors=remount - ro 0 1
/dev/hda5 none swap sw 0 0

/dev/hdc /media/cdrom0 UDF,iso9660 user, noauto 0 0

/dev/fd0 /media/floppt0 auto rw,user,noauto 0 0

The second hard drive identifies as a cdrom hdc.

I tried to mount hdc as ext3 and it wouldn't let me.
#mount -t ext3 /dev/hdc /mnt/testdrive

I next mounted hdc1 as ext3 successfully
then hdc3 mounted successfully also.

hdc 2 proved to the problem
#mount -t ext3/dev/hdc2 /mnt/testdrive2 would not mount it said wrong fs type.

I then tried
#mount -t iso9660 /dev/hdc2 /mnt/testdrive2 which worked

Now I can get to 2 of the partitions but the other one still eludes me, the system thinks it is a cdrom. So is there any way to change the system't thinking so I can write and change things?



Sorry for the length, verbose mode works well, I'm still having problems with terse mode.

Megabit in FL

tommcd 04-13-2010 03:53 PM

Quote:

Originally Posted by Megabitfl (Post 3934399)
The application is GNU GPL compliant (?), it was given to me as an img.gz on a flash drive. I had an unused pc with a 60 gig hd in it so I booted from a Linux Boot CD then #gunzip -c application.img.gz > /dev/hda. This put the image on the hard drive and rewrote the partitions, hda1, hda2, and hda3.

So, once again, does this application have a name?? Every GPL licensed application should at least have a name. If it is indeed licensed under GPL, then the source code should be freely available from somewhere. In order to be GPL compliant, the source code for the application must be available for anyone who wants it. It must also be possible for anyone to modify this source code. And it must also be possible for anyone to redistribute this modified source code in any way the user wants to. ...
So doe this mystery app have a name?? And what exactly does it do??? Can you answer these questions please????
Quote:

Originally Posted by Megabitfl (Post 3934399)
I then removed the hard drive and put it into my Debian 5 pc as the second hard drive. My thoughts were I would have root permission. I disconnected the cdrom so it wouldn't be a factor.

Why would it be necessary to to disconnect the cdrom drive in order to mount the second hard drive? This should not be necessary.
Quote:

Originally Posted by Megabitfl (Post 3934399)
I tried to mount hdc as ext3 and it wouldn't let me.
#mount -t ext3 /dev/hdc /mnt/testdrive

I next mounted hdc1 as ext3 successfully
then hdc3 mounted successfully also.

You can not mount an entire hard drive. You must mount a partition on the hard drive. This is why mounting /dev/hdc1 and /dev/hdc3 worked, and why trying to mount /dev/hdc did not.
Quote:

Originally Posted by Megabitfl (Post 3934399)
hdc 2 proved to the problem
#mount -t ext3/dev/hdc2 /mnt/testdrive2 would not mount it said wrong fs type.

I then tried
#mount -t iso9660 /dev/hdc2 /mnt/testdrive2 which worked

Now I can get to 2 of the partitions but the other one still eludes me, the system thinks it is a cdrom.

From the terminal, as root, post the output of:
Code:

# fdisk -l
This will list all the partitions on your system, whether they are mounted or not.

Megabitfl 04-14-2010 10:25 AM

TommCD,
I thought I had given the name earlier, my goof, I am working with Zeroshell using it's captive portal feature. We want to add some remote maintenance and drop a couple of cookies on the users. The CDrom was removed because I used it's cable and power to plug in the second hard drive.

The fdisk -l requested

debian:~# fdisk -l

Disk /dev/hda: 20.5 GB, 20547841536 bytes
255 heads, 63 sectors/track, 2498 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0001d13a

Device Boot Start End Blocks Id System
/dev/hda1 * 1 2405 19318131 83 Linux
/dev/hda2 2406 2498 747022+ 5 Extended
/dev/hda5 2406 2498 746991 82 Linux swap / Solaris

Disk /dev/hdc: 60.0 GB, 60022480896 bytes
32 heads, 61 sectors/track, 60057 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes
Disk identifier: 0x59eb2af7

Device Boot Start End Blocks Id System
/dev/hdc1 1 14 13633+ 83 Linux
/dev/hdc2 15 175 157136 83 Linux
/dev/hdc3 176 1015 819840 83 Linux
debian:~#


There may an easier way to accomplish this, our Linux "guru' moved on to greener pastures, I worked with UNIX 20 years ago so I got this project.

Megabit in FL

tommcd 04-15-2010 05:52 AM

Quote:

Originally Posted by Megabitfl (Post 3935391)
There may an easier way to accomplish this, our Linux "guru' moved on to greener pastures, I worked with UNIX 20 years ago so I got this project.

I don't know why you can not mount /dev/hdc2. For that matter, I don't know why your second hard drive would be /dev/hdc instead of /dev/hdb.
Is there anything on /dev/hdc2? The easiest way around this would be to format /dev/hdc2 with cfdisk, GParted, or a Parted Magic live CD. Then you should be able to mount it without problems.
What did you use to partition the second hard drive in the first place?

michaelk 04-15-2010 07:41 AM

IDE drive IDs are fixed i.e.
hda - first controller master
hdb - first controller slave
hdc - 2nd controller master
hdd - 2nd controller slave

The fstab file the OP posted indicated that the cdrom was connect to the 2nd controller master and since the 2nd hard drive is connected to the same cables it will also be recognized as hdc. BTW the output of fdisk does not indicate if a filesystem is mounted. The file is a entire drive image and therefore what ever partitions it contains will be the same on the drive when copied. I am not familiar with zeroshell but it is based on a live CD and the 2nd partition might indeed be a iso9660 filesystem. There is some information on the zeroshell's website on howto build packages from source but may not help with what you are trying to accomplish. What zeroshell image file did you copy?


All times are GMT -5. The time now is 07:49 PM.