LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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
 
LinkBack Search this Thread
Old 06-15-2008, 08:32 PM   #1
xbuffalo
LQ Newbie
 
Registered: Jun 2008
Posts: 6

Rep: Reputation: 0
/bin/bash: permission denied(after / partition moved)


I install Fedora 9 in a partition of 6.3G. Here is the result of 'fdisk -l'
Code:
Disk /dev/sda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x3af63af5

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         892     7164958+   b  W95 FAT32
/dev/sda2             893        2167    10241437+   c  W95 FAT32 (LBA)
/dev/sda3            2168        4079    15358140    c  W95 FAT32 (LBA)
/dev/sda4            4080        4864     6305512+   5  Extended
/dev/sda5            4080        4092      104391   83  Linux
/dev/sda6            4093        4222     1044193+  82  Linux swap / Solaris
/dev/sda7            4223        4864     5156833+  83  Linux
Because the '/' is growing bigger and bigger, I decide to get more space for my fedora. But the free space(/dev/sda3) is not adjacent to '/'(/dev/sda7), so i can't merge these two partitions using fdisk.
So I decide to move the '/' to /dev/sda3.
here is my steps:
(0) liveCD...
(1) mkfs.ext3 /dev/sda3
(2) mount -t ext3 /dev/sda3 /mnt/sda3/;mount -t ext3 /dev/sda7 /mnt/sda7/
(3) cp -a /mnt/sda7/* /mnt/sda3/
(4) modify /mnt/sda3/etc/fstab to change the location of ‘/’
(5) modify /boot/grub/grub.conf, add something as follows:
Code:
title NewFedora (2.6.25.3-18.fc9.i686)
        root (hd0,4)
        kernel /vmlinuz-2.6.25.3-18.fc9.i686 ro root=/dev/sda3 rhgb quiet
        initrd /initrd-2.6.25.3-18.fc9.i686.img
title Fedora (2.6.25.3-18.fc9.i686)
        root (hd0,4)
        kernel /vmlinuz-2.6.25.3-18.fc9.i686 ro root=/dev/sda7 rhgb quiet
        initrd /initrd-2.6.25.3-18.fc9.i686.img
The first title is all about of my 'new' system location. And I can login the original one.
(6) rebbot
I choose the NewFedora(/dev/sda3) and I can see the Fedora9 GUI login interface, I try login as root or other user, all failed. I switch to VT (using Ctrl+Alt+F1) to login in, failed. I try the ssh-client from other computer, got this:
Code:
last login.....
/bin/bash: permission denied.
I google the "/bin/bash: permission denied" and discover this land. I have read all title with '/bin/bash: permission denied', and I check the file system access mode.

here is the /dev/sda3:
Code:
[...]$ ll -a /mnt/sda3/
Total 96
drwxr-xr-x  19 root root 4096 06-15 22:28 .
drwxr-xr-x   5 root root 4096 05-17 21:57 ..
drwxr-xr-x   2 root root 4096 05-28 10:12 bin
drwxr-xr-x   2 root root 4096 05-17 18:15 boot
drwxr-xr-x   2 root root 4096 05-17 18:18 dev
drwxr-xr-x 124 root root 8192 06-15 22:28 etc
drwxr-xr-x   3 root root 4096 06-15 13:41 home
drwxr-xr-x  15 root root 8192 05-26 09:34 lib
drwx------   2 root root 4096 05-17 18:15 lost+found
drwxr-xr-x   2 root root 4096 06-15 22:25 media
drwxr-xr-x   5 root root 4096 05-17 21:57 mnt
drwxr-xr-x   2 root root 4096 05-17 18:15 proc
drwxr-x---  36 root root 4096 06-15 16:16 root
drwxr-xr-x   2 root root 8192 05-28 10:12 sbin
drwxr-xr-x   2 root root 4096 05-17 18:18 selinux
drwxr-xr-x   2 root root 4096 05-17 18:15 sys
drwxrwxrwt 129 root root 4096 06-15 22:27 tmp
drwxr-xr-x  13 root root 4096 06-01 14:38 usr
drwxr-xr-x  23 root root 4096 05-17 16:01 var
here is my 'new' system's fstab:
Code:
UUID=bea271e0-5490-4701-9039-3e2e432b87f5 /                       ext3    defaults        1 1
UUID=ff4b53a9-a43e-4e0f-8159-d39ad8b0a51d /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
UUID=eff25086-826d-4d3e-9694-27cc0cc497f6 swap                    swap    defaults        0 0
I can't login in this 'new' system, so I can't use strace to debug this problem.
I hate reinstall system. I need your help. Any suggestion will be appreciate.

Last edited by xbuffalo; 06-16-2008 at 12:44 AM.
 
Old 06-16-2008, 09:10 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,402

Rep: Reputation: 212Reputation: 212Reputation: 212
You moved the root partition, but did you run grub-install to tell grub the new location.
 
Old 06-17-2008, 01:01 AM   #3
xbuffalo
LQ Newbie
 
Registered: Jun 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Unhappy

Quote:
Originally Posted by bigrigdriver View Post
You moved the root partition, but did you run grub-install to tell grub the new location.
Thank u for reply.
I didn't do grub-install.
I have modified /boot/grub/grub.conf to tell the location of my new '/' partition, and when system boot up, it works.
The key problem is 'bash' permission error, but the sshd and login are ok.
I don't know why.
 
Old 06-17-2008, 01:23 AM   #4
CSIG
LQ Newbie
 
Registered: Apr 2008
Posts: 11

Rep: Reputation: 1
link /usr and /var

In the past I have solved similar situations (more space needed for root partition) by moving the /usr and /var directory to the new partition, creating softlinks to these new locations in the root partition. In that case GRUB settings are unchanged and only /etc/fstab has to be modified to auto-mount the new partition.

As for your current problem I would suggest to either copy back everything and see if you can restore the system that way before proceeding with any alternatives.

I'm also curious what user account from the LiveCD was in charge when you copied everything. You should check what user ID's are involved, the displayed names can be misleading. I suspect that there is really some permission problem involved, somehow.
 
Old 06-17-2008, 04:31 AM   #5
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: SuSE 11.4_64-KDE, 12.1_64-KDE
Posts: 3,344

Rep: Reputation: Disabled
Why don't you use (g)parted?
 
Old 06-18-2008, 01:04 AM   #6
xbuffalo
LQ Newbie
 
Registered: Jun 2008
Posts: 6

Original Poster
Rep: Reputation: 0
I did 'cp -a' as root in liveCD.
"creating softlinks to these new locations in the root partition" is a nice try.
 
Old 06-18-2008, 01:13 AM   #7
xbuffalo
LQ Newbie
 
Registered: Jun 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by JZL240I-U View Post
Why don't you use (g)parted?
Sorry, I hadn't heard about (g)parted.
I gonna have a try.
 
Old 06-19-2008, 01:18 AM   #8
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: SuSE 11.4_64-KDE, 12.1_64-KDE
Posts: 3,344

Rep: Reputation: Disabled
Umm, parted is the program there are at least two frontends. You can either use gparted (gnome) or KDE's qtparted. I simply forgot to mention that, so please do not search for the program with the brackets still contained in its name.
 
  


Reply

Tags
denied


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
su: /bin/bash: Permission denied fedora4002 Linux - Security 5 01-29-2010 08:46 AM
Cannot execute /bin/bash: Permission denied Z038 Slackware 13 06-23-2007 09:34 PM
su: /bin/bash: Permission denied dwarf007 Linux - General 10 01-20-2006 04:32 PM
Cannot execute /bin/bash: Permission denied Hegemon Linux - General 4 01-19-2004 04:13 AM
cannot execute /bin/bash: Permission Denied peeples Linux From Scratch 24 10-25-2002 08:07 AM


All times are GMT -5. The time now is 06:58 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration