LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   fopen: Permission denied as root after fresh install with new manually mount points (https://www.linuxquestions.org/questions/linux-newbie-8/fopen-permission-denied-as-root-after-fresh-install-with-new-manually-mount-points-4175495684/)

metrx 02-20-2014 03:00 PM

fopen: Permission denied as root after fresh install with new manually mount points
 
Hey Guys,

I have more or less succesfully setup my Dual Boot of Windows 7 Ultimate and Debian 7 Wheezy on 2 HDD.

I have my OS running on /dev/sda which is a 120GB Samsung SSD 840 Pro series.

Whereas I run my SWAP partition on /dev/sdb(2) which is a WD 500GB Sata. I also run a NTFS partition for paginf files under Windows on it and my plan was to run /home and /var on it as well.

I guess, it screwed up in the last part.

The installation of such setup up was as following:
unplug /dev/sdb and only have the SSD.

1.5 Install Windows as usual, and leave space for debian
1.6 Install Debian without any other special configuration in the partition on the remaining /dev/sda space!

2. After installations, make sure both systems boot - check works
2.1 Go into Linux and start fdisk /dev/sdb to make some stuff on it. This includes creating a SWAP partition on /dev/sdb2, run mkswap etc, as it is written in the debian wiki

2.2 create a partition for /home and for /var (ext4)

Then I believe, it messed up, because I started to mount them. I wanted to do some aptitude afterwards, but I recognised, oops, /var is empty. So I unmounted it as well as and cp -r /var to my new /home
Afterwards I mounted my /var again and cp -r /home/var/* /var/

I guess, as I am writing this, I messed up the privilegeds and therefore I get a permission denied as ROOT ?

The way I recognised it, there where such messages during aptitude dist-upgrade and now:

Code:

root@dbkakarot:/home/bs/Downloads# dpkg -i google-chrome-stable_current_amd64.deb
Selecting previously unselected package google-chrome-stable.
(Reading database ... 42764 files and directories currently installed.)
Preparing to unpack google-chrome-stable_current_amd64.deb ...
Unpacking google-chrome-stable (33.0.1750.117-1) ...
dpkg: dependency problems prevent configuration of google-chrome-stable:
 google-chrome-stable depends on gconf-service; however:
  Package gconf-service is not installed.
 google-chrome-stable depends on libgconf-2-4 (>= 2.31.1); however:
  Package libgconf-2-4 is not installed.
 google-chrome-stable depends on xdg-utils (>= 1.0.2); however:
  Package xdg-utils is not installed.

dpkg: error processing package google-chrome-stable (--install):
 dependency problems - leaving unconfigured
Processing triggers for mime-support (3.54) ...
Processing triggers for man-db (2.6.6-1) ...
fopen: Permission denied
Errors were encountered while processing:
 google-chrome-stable

FSTAB:
Code:

root@dbkakarot:/home/bs/Downloads# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
# / was on /dev/sda5 during installation
UUID=2627c2b1-c6b4-48dd-8605-c96c48d94013 /              ext4    errors=remount-ro 0      1
/dev/sr0        /media/cdrom0  udf,iso9660 user,noauto    0      0
/dev/sdb1      /media/usb0    auto    rw,user,noauto  0      0
/dev/sdb5        /home        auto        defaults        1        1
/dev/sdb6        /var        auto        defaults        1        1
#Swap partition created on 201402201900
UUID=21ad62c3-b6da-40b6-b546-711193c83631        none        swap        sw        0        0

(/dev/sdb1 is the paging partiton for windows)

Code:

root@dbkakarot:/home/bs/Downloads# fdisk /dev/sdb

Command (m for help): p

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x80a0bf58

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1            2048  125206527    62602240    7  HPFS/NTFS/exFAT
/dev/sdb2      125206528  242647039    58720256  82  Linux swap / Solaris
/dev/sdb3      242647040  976773167  367063064    5  Extended
/dev/sdb5      242649088  452364287  104857600  83  Linux
/dev/sdb6      452366336  473337855    10485760  83  Linux

Code:

root@dbkakarot:/home/bs/Downloads# fdisk /dev/sdb

Command (m for help): p

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x80a0bf58

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1            2048  125206527    62602240    7  HPFS/NTFS/exFAT
/dev/sdb2      125206528  242647039    58720256  82  Linux swap / Solaris
/dev/sdb3      242647040  976773167  367063064    5  Extended
/dev/sdb5      242649088  452364287  104857600  83  Linux
/dev/sdb6      452366336  473337855    10485760  83  Linux

example of /var
Code:

root@dbkakarot:/home/bs/Downloads# l /var/
total 44K
4.0K drwxr-xr-x 11 root root 4.0K Feb 20 19:17 .
4.0K drwxr-xr-x 22 root root 4.0K Feb 20 20:48 ..
4.0K drwxr-xr-x  2 root root 4.0K Feb 20 19:17 backups
4.0K drwxr-xr-x  8 root root 4.0K Feb 20 20:12 cache
4.0K drwxr-xr-x 32 root root 4.0K Feb 20 20:26 lib
4.0K drwxr-xr-x  2 root root 4.0K Feb 20 19:17 local
  0 lrwxrwxrwx  1 root root    9 Feb 20 19:17 lock -> /run/lock
4.0K drwxr-xr-x  7 root root 4.0K Feb 20 20:33 log
4.0K drwxr-xr-x  2 root root 4.0K Feb 20 19:17 mail
4.0K drwxr-xr-x  2 root root 4.0K Feb 20 19:17 opt
  0 lrwxrwxrwx  1 root root    4 Feb 20 19:17 run -> /run
4.0K drwxr-xr-x  5 root root 4.0K Feb 20 19:17 spool
4.0K drwxr-xr-t  2 root root 4.0K Feb 20 20:48 tmp

Now, luckily I guess, I have not deleted /var or /home from the original installation which should still be on /dev/sda !

Does anyone know how to fix this ?

All the best,


Code:

root@dbkakarot:/home/bs/Downloads# uname -a
Linux dbkakarot 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64 GNU/Linux

EDIT:
I kinda figured it out, for now everything works again, but I am not too sure about the longterm solution here..
After a bit of research I found out, that I would need to grand the user man the rights in the man folder. As well as its sub directories, with the chmod of 775


All times are GMT -5. The time now is 09:12 AM.