# permission denied when trying to configure kernel (solved)

## jorgepeixoto

Hi. 

I have moved /usr/src to /mnt/hdc1/usr/src; /usr/src is now a symlink to /mnt/hdc1/usr/src.

See what is happening to me:

```

cd /mnt/hdc1/usr/src/linux-2.6.22-gentoo-r2/

jorge@jorge /mnt/hdc1/usr/src/linux-2.6.22-gentoo-r2 $ sudo make menuconfig

  HOSTCC  scripts/basic/fixdep

/bin/sh: scripts/basic/fixdep: Permission denied

make[1]: *** [scripts/basic/fixdep] Error 1

make: *** [scripts_basic] Error 2

jorge@jorge /mnt/hdc1/usr/src/linux-2.6.22-gentoo-r2 $ ls -l scripts/basic/fixdep

-rwxr-xr-x 1 root root 10841 2007-07-30 20:27 scripts/basic/fixdep

```

What could be causing this?

Some more information:

```

grep hdc1 /etc/fstab

/dev/hdc1               /mnt/hdc1       reiserfs        noatime,notail,user             0 2

uname -a

Linux jorge 2.6.22-gentoo-r2 #1 PREEMPT Sun Jul 29 20:50:40 BRT 2007 i686 AMD Athlon(tm) XP 2600+ AuthenticAMD GNU/Linux

```

The problem persists if I unmerge gentoo-sources, remove the usr/src/linux-2.6.22-gentoo-r2 directory, and merge gentoo-sources again.

EDITEDLast edited by jorgepeixoto on Tue Jul 31, 2007 10:53 am; edited 4 times in total

----------

## Bobnoxous

Are you root when you're running:

> sudo make menuconfig

If so, that would see if root is in the sudo configuration. Now what you want. If you're root, don't use sudo.

----------

## eccerr0r

Are you on NFS?  And that NFS share is root_squash?

----------

## jorgepeixoto

 *Bobnoxous wrote:*   

> Are you root when you're running:
> 
> > sudo make menuconfig
> 
> If so, that would see if root is in the sudo configuration. Now what you want. If you're root, don't use sudo.

 

I'm calling sudo with my regular user; I said "I'm root" because sudo gives root permissions. I'll change the title to clarify. When I su to root and then issue make menuconfig the results are the same.

 *Quote:*   

> 
> 
> Are you on NFS? And that NFS share is root_squash?
> 
> 

 

No, I'm not. I don't think the following information is useful, but I'll give it anyway. 

My fstab (with some of the comments omitted):

/dev/hda2		/		reiserfs	noatime,notail			0 1

/dev/hdc1		/mnt/hdc1	reiserfs	noatime,notail,user		0 2

/dev/hda1		none		swap		sw,pri=1		     	0 0

/dev/hdc2		none		swap		sw,pri=0	     		0 0

/dev/hdb		/mnt/cdrom1	auto		noauto,user,ro			0 0

/dev/fd0		/mnt/floppy	auto		noauto,user			0 0

/dev/sda1		/media/camera	vfat		noauto,user			0 0

none			/var/tmp 	tmpfs		size=10000M,defaults		0 0

none                    /tmp      	tmpfs          	size=128M,defaults              0 0

# NOTE: The next line is critical for boot!

none			/proc		proc		defaults			0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for 

# POSIX shared memory (shm_open, shm_unlink).

# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will

#  use almost no memory if not populated with files)

none			/dev/shm	tmpfs		nodev,nosuid,noexec		0 0

----------

## tarpman

```
sudo chmod +x /mnt/hdc1/usr/src/linux-2.6.22-gentoo-r2/scripts/basic/fixdep
```

I'm guessing that when you moved the files to the new partition, you used some command that doesn't preserve permissions.  If you run into similar errors further along with other scripts, they'll probably need chmodding too.

In future, use something like rsync -av or cp -av to preserve permissions over a copy.

Even root isn't allowed to execute a file that doesn't have the executable bit set.  :Smile: 

----------

## jorgepeixoto

 *tarpman wrote:*   

> 
> 
> ```
> sudo chmod +x /mnt/hdc1/usr/src/linux-2.6.22-gentoo-r2/scripts/basic/fixdep
> ```
> ...

 

That is not an issue. I have edited the first post to address your concerns.

----------

## Bobnoxous

My only other idea is that the partition is not writable. Make sure it's not full.

----------

## Genone

Your problem is teh "user" option in /etc/fstab, as it implies noexec, so nothing on hdc is actually executable. See the "mount" manpage for more details.

----------

## jorgepeixoto

 *Genone wrote:*   

> Your problem is teh "user" option in /etc/fstab, as it implies noexec, so nothing on hdc is actually executable. See the "mount" manpage for more details.

 

Problem solved. Thank you.

----------

