FedoraThis forum is for the discussion of the Fedora Project.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Fedora 8 was installed to /dev/sda3 on the original 160 GB hard drive. A
second, 200 GB hard drive was later installed. Using Knoppix, I mounted
/dev/sda3 and /dev/sdb2 on /media/sda3 and /media/sdb2. I changed into
the /media/sda3 directory and issued "cp -a * /media/sdb2", still
running on Knoppix. I checked the copy while still in Knoppix with
"diff -r etc/ /media/sdb2/etc/", etc. It seems that I have a good copy
of Fedora 8 on /dev/sdb2, and after setting up fstab and grub, it boots
with no errors.
The problem: I cannot log in. Error message:
vega login: root
Last login: Wed Oct 1 11:04:21 on tty1
login: no shell: Permission denied.
I tried again, almost immediately:
vega login: root
Last login: Wed Oct 1 11:04:35 on tty1
login: no shell: Permission denied.
Notice the time of last login. It is keeping track of the time of
logins, as if they are successful. Both the original and the copy of
/bin/login are identical, according to diff.
According to "diff /etc/passwd /mnt/f8/etc/passwd", as well as shadow
and group, those files are all the same.
I thought I would have to rebuild /boot/initrd, but it appears to be
working. There are no errors or warnings in /var/log/messages. The
reference to initrd in the log is the usual:
Oct 1 22:42:15 vega kernel: Freeing initrd memory: 2997k freed
According to /var/log/secure, my login are successful, then nothing
happens, so, I issue a CTL-ALT-DEL:
Oct 1 23:00:48 vega login: pam_unix(login:session): session opened for
user root by LOGIN(uid=0)
Oct 1 23:00:48 vega login: ROOT LOGIN ON tty1
Oct 1 23:00:48 vega login: pam_unix(login:session): session closed for
Oct 1 23:00:57 vega sshd: Received signal 15; terminating.
1) A default Fedora installation would have had /boot on one partition and swap and / inside a LV in a second partition. Unless you overrode those defaults, you can't get a working installation from a cp * on a mounted fs. You'd need, at a minimum, to use dd to do the copy of the whole disk.
2) The cp -a * should recursively copy everything. That includes /dev which, on almost all systems, contains /dev/random and /dev/zero. A cp of any of those special devices should have filled your destination device with either random numbers or zeros, and I'm not sure what copying /dev/null would have accomplished. Again, dd would, I think, have been a better choice.
3) The initial RAM Disk (initrd) is just that: a small Linux shell used to boot the "real" system from the HD. So you seldom need to make changes in it. About the only time I've needed to change it was when I change the name of the VG and LV where Fedora resides.
I am retired. This is a home, hobby machine. I am System Admin. for
the three computers sitting in front of me at home. This is a laptop,
the other two are desktops, setup much like this one. I have no exper-
ience with logical volumes. I don't think an LV would be useful to me.
If I'm wrong, please enlighten me. Since F8 was not running, /dev/ was
If dd makes a block by block image of the partition, I can't use it to
move a 5.9GB system from a 64.3GB partition to a 12.9GB partition.
Sorry I didn't give that much information in the first post.
I want to move Fedora 8, and replace it with F10 soon, rearrange the
partitions on /dev/sda, get rid of Vista (I've booted it once in the
year I've had it), and install Scientific Linux and Arch Linux on sda.
That will leave about 40GB open on sda.
I want to copy all of Fedora but /home/ to sdb2, and put /home/ on sdb3.
I ran diff on each directory (but not immediately), and found some
expected differences. I also tried:
star -copy -p -xdot -V pat=home/\* -C /media/sda3 . /media/sdb2
It copied only 1/3 of the directories (233MB). With 2GB of RAM and a
2GB swap partition on each drive, it seems like star could stream less
than 6GB between two partitions in the copy mode.
I've done some reading about the various GUI software. The ones I've
looked at so far that say that they only copy used blocks, seem to use
dd to make images. They say that they only copy used blocks, but when
you get into their tutorials, you find that you cannot transfer to a
smaller partition, and if you transfer to a larger partition, you
loose space. That means that they are creating an image of the entire
drive. I guess they copy only blocks used by the file system. I didn't
want to try to grow sdb2 with the later partitions in use. Gparted is
well done, but I'm not sure it's that good. I've used tar for files and
directories, but I've never been able to make it do this either.
I'm sure you know more about this than I. What would you suggest I do
next? Of course, I could reinstall, but that's giving up, and there
should be a way to simply copy all the system files to any file system
that's big enough to hold the files. It still seems that "cp -a *"
ought to do it.
Last edited by Bob Barrett; 10-03-2008 at 09:13 PM.
From your fdisk it seems you didn't use the Fedora defaults when you installed. (And I agree that LVM is probably over-kill for a simple laptop. It's the default in Fedora simply because Fedora is the Beta platform for RHEL, and RHEL installations will typically fine LVM a very useful tool.) I have it running on my laptop just because, as a mathematician, I like abstraction, so adding another layer of abstraction to the system's drives strikes me as fun.
So, one thing to check is if the entries in /etc/fstab or correct for the new system location, and if your system boot setup is pointing to the correct location and file. Entries in fstab can refer to files by physical device, label, uuid, etc., as can RUB boot entries.
The initial RAM disk should automatically locate and use any swap partitions on you system, but fstab often specifies a swap partition location, so verify that it, too, is correct.
The error message you're getting -- "no shell" -- is telling you that the login command could not locate /bin/bash in your attached file system. I.e., You had logged in (hence the time change), but the login process could not start the shell program. That's why I suspect that fstab may be mounting the wrong device or partition as /.
But the cp you ran should have moved everything correctly for you.
I mentioned initrd because I thought I remembered reading somewhere
that initrd included a reference to the boot partition, since it's job
is to mount a temporary root file system. But that is unloaded long
Everything is working, through /etc/rc.d/rc.local (ten key number pad
is activated). As a mathematician, I'm sure you appreciate the idea
that the number pad should always be on, and to turn it off should
should require extreme effort.
I've found something! I had just booted into single user mode, and
was poking around in /var/log/messages. A reference to Selinux got
my attention. There was no warning, or error, but I decided to turn
off Selinux and try it. That did it. No problem logging in. I booted
and logged in three times. Then I changed it back. Tried it again.
A message came up while booting announcing that Selinux had to relabel
the drive, and that it would take a long time. It took a couple of
minutes. I expected to not be able to login, but that didn't happen.
So now I have logged in for the fifth time, even with Selinux enforcing,
and yum is updating.
Thank you, I couldn't have done it without you. Now we know that
"cp -a" can do it.
Looking at your fstab, I note that you're using the /dev/sd?? form to reference your file systems. While that form will often work, it does make the assumption the device names are static. This can be a problem since many loaders (e.g., GRUB) may "re-order" the BIOS assignment of device locations.
It's safer, in most cases, to use the LABEL= or UUID= forms. Here, for example is my laptop's fstab
Note that I have three different distribution on this laptop, each with it's own /boot directory. I usually only attach one of them as "/boot," which is why the other two are commented out in this (my F9) fstab.
If you do a ls -l of /dev/disk/by-uuid or /dev/disk/by-label you can see the label and UUID of all the physical devices on you system. Oh, the /dev/vg_name/lv_name stuff is for logical volumes after dm has has been called by udev to attach them to /dev.
By way of contrast, here's the fstab from the Kubuntu distribution on the same laptop. Ubuntu, like your F9 installation, uses a single file system instead of a boot partition and a root in a different partition.
Re SELinux, what I've done is set it to "permissive" mode, so it only generates warning messages. I review them every once and a while, but, so far, all I've seen is problems caused by updating my system. (Several RPMs check "locked" areas for error messages. If active, SELinux would have prevented those checks.)
Of course I have almost all access to the laptop blocked at my router's firewall, and then at the laptop's firewall, and all accounts on the system are password protected. And, since I've been retired for several years now, there's nothing on my system but a few personal files of no significance if lost. (No CC information, etc., is ever stored on the system.) So, for me, SELinux in permissive mode is "good enough."