LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Use live knoppix to edit fstab on hda1 (https://www.linuxquestions.org/questions/linux-newbie-8/use-live-knoppix-to-edit-fstab-on-hda1-564699/)

mg92865 06-26-2007 07:25 PM

Use live knoppix to edit fstab on hda1
 
Background: This problem is with a Fedora 5 installation, on a machine with previously one
hard drive. The machine and install has never given any problems in the past year. I installed an additional data disk which I can see but cannot write to, I now assume because the permissions are set incorrectly.


What I did to cause the problem: I have changed the /etc/fstab file and now the machine will not boot.

I can boot the machine with a Knoppix 5.1.1 Live DVD, however I do not understand how to mount my original hda1, and work on the fstab file. I kept a virgin copy in the /etc folder, so I believe it is a matter of renaming the fstab.old file to fstab.

I have figured out how to set a password to be able to log on as root, but I seem not to understand how to open my original hard drive, ie where mangled /etc/fstab resides.

Can anyone point me to a good article on this so I get an understanding of how to use a rescue disk in a case like this.


Thank you for any direction you can provide

mg92865

pixellany 06-26-2007 08:10 PM

Once you get in a terminal (as root):
fdisk -l to see all the drives and partitions
mkdir /mnt/somename to make a mount point
mount /dev/hda1 /mnt/somename to mount the partition to the mountpoint
cd /mnt/somename AND
ls to see the contents

(replace "somename" and "hda1" with appropriate entries)

To edit fstab:
nano etc/fstab (Not no leading "/"--you want the etc/fstab that is on /mnt/somename (AKA /dev/hda1))
If nano is not installed, then kedit, kwrite, or whatever editor IS there.

Junior Hacker 06-26-2007 08:13 PM

It is best to use the distribution's install disc, for Fedora, try this:

1: Boot from Fedora Core Linux 1st CD or DVD:
Set BIOS to boot from CD/DVD rom. At boot: prompt type command linux rescue
Code:

boot: linux rescue
Just follow on screen instructions, when prompted let the installer search for your Linux installation. If the search operation is successful, your old Linux installation will be available at special directory called /mnt/sysimage.
Code:

# chroot /mnt/sysimage
From a root shell, it may be best to remove /etc/fstab first before moving (renaming) /etc/fstab.old to /etc/fstab.

From a live CD with /dev/sda2 as an example for your Fedora / partition, mount the device in read/write by first un-mounting it, assuming the live CD sees it as /media/sda2, and the file system is ext3:
Code:

# umount /media/sda2
# mount -o rw -t ext3 /dev/sda2 /media/sda2

Now navigate to /etc and make the changes, then un-mount it again to save changes.

mg92865 06-26-2007 09:15 PM

Thank you for your input. At this point my results were not successful.

Junior Hacker - The problem here is that is still a problem with the extra data drive that I added (hdb1 and hdb2), and this stops the install per your directions, only offering me the option to reboot. This happend with the drive present, and again after I pulled the data drive, so something in the configuration files must not like the way I have the hdb1 and hdb2 set up.


Quote:

Originally Posted by pixellany
Once you get in a terminal (as root):
fdisk -l to see all the drives and partitions
mkdir /mnt/somename to make a mount point
mount /dev/hda1 /mnt/somename to mount the partition to the mountpoint
cd /mnt/somename AND
ls to see the contents

(replace "somename" and "hda1" with appropriate entries)

To edit fstab:
nano etc/fstab (Not no leading "/"--you want the etc/fstab that is on /mnt/somename (AKA /dev/hda1))
If nano is not installed, then kedit, kwrite, or whatever editor IS there.


mg92865 06-26-2007 09:17 PM

Thank you for your input. At this point my results were not successful.

Although your instructions seem simple, it is not within my skillset
yet. I will review the man commands for your suggestions a bit more to see if I can follow this.

All help is appreciated, as it is how I have actually learned how to use and install Linux. Thank you again for your efforts.

I will likely wait a day or two to see if other suggestions appear. If not, I will pull the hard drives, install a small spare, reinstall, and look for a way to recover any files that need to be backed up.

mg92865

Quote:

Originally Posted by pixellany
Once you get in a terminal (as root):
fdisk -l to see all the drives and partitions
mkdir /mnt/somename to make a mount point
mount /dev/hda1 /mnt/somename to mount the partition to the mountpoint
cd /mnt/somename AND
ls to see the contents

(replace "somename" and "hda1" with appropriate entries)

To edit fstab:
nano etc/fstab (Not no leading "/"--you want the etc/fstab that is on /mnt/somename (AKA /dev/hda1))
If nano is not installed, then kedit, kwrite, or whatever editor IS there.


Junior Hacker 06-26-2007 09:48 PM

Is it possible for you to post the output of the command: fdisk -l here, that is if you can boot Knoppix with the second drive installed and run that command. You can highlight/copy the output from the terminal and paste it in kwrite editor and save it to a USB flash drive or floppy with a name ending in .rtf which will not be changed around when viewing the file from Wordpad in Windows. Than we can give assistance in writing the proper configuration in /etc/fstab of the Linux.
Also post the /etc/fstab file would be a great help.

mg92865 06-27-2007 08:49 AM

OK, this is the results of the fdisk command. If you wanted to see the contents of my (not knoppix created fstab) fstab, I will need help in determining how to do that. If there is anything I can provide, please ask. Thank you again for your assistance.

mg92865

RESULTS:

knoppix@Knoppix:~$ fdisk -l
knoppix@Knoppix:~$ su
root@Knoppix:/ramdisk/home/knoppix# fdisk -l

Disk /dev/hda: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 4998 40042012+ 8e Linux LVM

Disk /dev/hdb: 400.0 GB, 400088457216 bytes
255 heads, 63 sectors/track, 48641 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End
Blocks Id System

/dev/hdb1 1 44458 357108853+ b W95 FAT32
/dev/hdb2 44459 48641 33599947+ 83 Linux

root@Knoppix:/ramdisk/home/knoppix#


Quote:

Originally Posted by Junior Hacker
Is it possible for you to post the output of the command: fdisk -l here, that is if you can boot Knoppix with the second drive installed and run that command. You can highlight/copy the output from the terminal and paste it in kwrite editor and save it to a USB flash drive or floppy with a name ending in .rtf which will not be changed around when viewing the file from Wordpad in Windows. Than we can give assistance in writing the proper configuration in /etc/fstab of the Linux.
Also post the /etc/fstab file would be a great help.



All times are GMT -5. The time now is 04:46 PM.