Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Yes when using knoppix I chose linux single linux single at the boot prompt. I changed the root password but when rebooting the server I end up at a login prompt and it does not recognize the password. Also, grub does not have any hidden entries or passwords. I set the timeout to 10 seconds and now get a blank screen for 10 seconds.
Try at the login window the commands from previous post, or edit with live-cd.
Check out 1.4 http://www.gentoo.org/doc/en/handboo...?part=2&chap=4
You will set to single user then reboot & make changes then set it back to boot to gui.
That sounds like you were changing things in the LiveCD working image(s), not in things on your HD. To make changes to your HD, you have to mount the HD's filesystem(s), and work with them, not the LiveCD file systems.
Assuming you're using the SystemRescue livecd, you can boot to a Gentoo GUI interface, with a terminal window open. Or you can choose to just stay with the rescue console. The suggestions below should all work with both choices, except for the last command (geany which is a GUI editor, so it need a running X-windows system.
In the terminal, enter the following commands (Anything from a # to the end of a line is a comment):
Code:
fdisk -l /dev/sd? # This will list all the partitions on all your hard drives
# Here's a sample output with comments
#Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors #Hard drive a represented symbolically a sda, sdb, ...; disk drives as sdr, sdro, stc.
#Units = sectors of 1 * 512 = 512 bytes # These three lines are the description of the physical layout of the drive
#Sector size (logical/physical): 512 bytes / 512 bytes
#I/O size (minimum/optimal): 512 bytes / 512 bytes
#Disk label type: dos # The "label" is the partition method use for the drive
#Disk identifier: 0x767f9c5a
#
# Device Boot Start End Blocks Id System # This is the description of each partition
#/dev/sdb1 * 16065 902435309 451209622+ 83 Linux # The first partition (/dev/sda1) is a Linux partition
#/dev/sdb2 902436864 1926443007 512003072 fd Linux raid autodetect # The second one is a special use Linx one
#/dev/sdb3 1926443008 3907028991 990292992 7 HPFS/NTFS/exFAT # The third is a Windows partition
#
# Review your output to identify your Linux partitions.
#
# ASSUMING that one of them is /dev/sda1 try this (Note: Unless only one partition is a Linux one,
# the most likely partition is one not flagged as a "boot" partition.)
mount /dev/sda1 /mntls /mnt/etc
# If this command fails, try another Linux partition.
# enter these commands to do that:
# exit # To quit the chroot process
# umount /mnt # To unmount the partition. (No "n" after the "u.")
# mount /dev/sda2 # To mount the second partition.
# and try the ls command again.
cat /etc/issue # To see what flavor of Linux is on the HD.
# You should see something like this
# cat /etc/issue
#Fedora release 19 (Schrödinger’s Cat)
#Kernel \r on an \m (\l)
#
# Now change your base file system to be the partition you identified on your HD
chroot /mntpasswd # To change the "root" password
sync # To make sure that the changes are written to the HD
# Now, at this point you've change the root password, so you can reboot and see if you can proceed from there
# or you can try to edit the grub files.
# To do that, using the SysRescue tools do this:
exit # To close the chroot session
ls /mnt/boot # To see if the HD's boot directory is mounted.
# If the directory listing is empty, your distribution may use a separate boot partition.
# Try mounting any other Linux partitions you identified as /mnt/boot
# mount /dev/sda1 /mnt/boot
# And, once again, try the ls /mnt/boot
#Once the /mnt/boot directory contains a grub subdirectory, look in it to find the GRUB
# boot file.
ls /mnt/boot/grub/
# And edit it
geany /mnt/boot/grub/menu.lst
thanks ptrenholme thats very detail i appreciate that. bad weather being force to leave work early and i will not get a chance to try till the 28th, please don't close this post.
Do a ls /mnt to verify that you've mounted the correct file system. It should look a little like this:
Code:
Backups boot etc ISO lib64 media Mirror opt proc run sbin sys usr Wallpapers
bin dev home lib lost+found MiniSD mnt Passport root Samba srv tmp var Win7
(Note that anything in that list that starts with a capital letter is NOT something you should expect to see.)
If that looks OK, try this (as "root," of course):
Code:
mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
chroot /mnt
(What that does is make the kernel files (/proc, etc.) from the kernel you're running available to the new root you're setting.)
meant:
mount --bind /dev /mnt/dev
mount: mount point /mnt/dev does not exist
mount --bind /sys /mnt/sys
mount: mount point /mnt/sys does not exist
Should not be difficult to change root password. I have vi passwd and shadow and rebooted to still end up at some login that does not accept root/password. Following both ptrenholme (above) and various knoppix online user instructions. I have tried the gui and started a terminal and cli boot#linux single, mounted sda2 which fdisk -l shows as boot partition.
This is NOT what you want to see. Try a ls /mnt/sda2 or a ls /mnt/sda3 and look for something like I posted above.
I suspect that /mnt/sda2 will have your /boot files in it, and /mnt/sda3 will have the rest of you system
in it, so the ls /mnt/sda3 output will look similar to what I posted.
ASSUMING that is correct do the following:
Code:
umount /dev/sda2
mount /dev/sda2 /mnt/sda3/boot
mount --bind /dev/proc /dev/sda3/proc
mount --bind /dev/sys /dev/sda3/sys
chroot /mnt/sda3
Here's an example using an older Fedora system mounted as /Mirror (I.e., /dev/sda3 on your system if my ASSUMPTION is correct)
I've added comments in red to this example.
Code:
$ ls -1 /Mirror/ # Check that this looks like a linux base (/) file system.
bin
boot
coda
dev
etc
home
lib
lib64
lost+found
media
mnt
opt
proc
root
run
sbin
selinux
srv
sys
tmp
usr
var
$ ls /Mirror/boot/ # If my assumption is correct, you should see something like this after mounting /dev/sda2 as /mnt/sda3/boot
boot-isos initramfs-3.8.11-200.fc18.x86_64.img ubnfilel.txt
config-3.8.11-200.fc18.x86_64 initramfs-3.8.8-202.fc18.x86_64.img ubnpathl.txt
config-3.8.8-202.fc18.x86_64 initramfs-3.8.9-200.fc18.x86_64.img vmlinuz-3.8.11-200.fc18.x86_64
config-3.8.9-200.fc18.x86_64 initrd-plymouth.img vmlinuz-3.8.8-202.fc18.x86_64
custom.cfg.new System.map-3.8.11-200.fc18.x86_64 vmlinuz-3.8.9-200.fc18.x86_64
extlinux System.map-3.8.8-202.fc18.x86_64
grub2 System.map-3.8.9-200.fc18.x86_64
$ ls /Mirror/proc # Since the kernel creates this, it should be empty if the system is not running
$ sudo mount --bind /proc /Mirror/proc$ sudo mount --bind /sys /Mirror/sys$ sudo chroot /Mirror/ # This moves the root fs and starts a root login session on /mirror# cat /etc/issue # Just so you can see that the root fs was moved
Fedora release 18 (Spherical Cow)
Kernel \r on an \m (\l)
## I didn't execute this block of commands since haven't lost my passwords . . .
# passswd # To change the root password
# /home/ # To see which home directories (users) are defined.
Peter
# passwd Peter # To change a user's password.
##
# exit # This exits the root shell.
exit
$ cat /etc/issue # To show that we're back
Fedora release 19 (Schrödinger’s Cat)
Kernel \r on an \m (\l)
$ sudo umount /Mirror/proc /Mirror/sys # Housekeeping: No reason to keep the mounts after I'm done
Last edited by PTrenholme; 05-30-2013 at 11:41 PM.
OK at it again PTrenholme, on the GUI and opened a terminal and did a root@microknoppix:ls /mnt
got bin grub kernel.h lib lost&found old_system recover system
probably what was expected...however, the mount --bind /proc /mnt/proc commands do not exist nor does ls -l /Mirror/.
fdisk -l
device boot start end blocks id system
sda2 * 1 194 195520+ 83 linux
sda3 195 250 56448 83 linux
mount /dev/sda2 /mnt...worked
ls /mnt/etc..did not
umount /mnt
exit
mounted /dev/sda3 and ls and only got desktop.
root@microknoppix:/home/knkoppix# chroot /mnt andI get ...chroot:failed to run command bin/bash: no such file or directory
I was able to vi passwd and shadow, bring up eth0 and assign ip, netmask and route. I can ping it from another subnet now. Is there anyway to test both the root/new password and ip addressing "took" before I close this terminal and restart the server?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.