LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 06-26-2007, 07:25 PM   #1
mg92865
Member
 
Registered: Jun 2006
Distribution: Ubuntu
Posts: 35

Rep: Reputation: 16
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

Last edited by mg92865; 06-26-2007 at 07:26 PM.
 
Old 06-26-2007, 08:10 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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.
 
Old 06-26-2007, 08:13 PM   #3
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
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.

Last edited by Junior Hacker; 06-26-2007 at 08:35 PM.
 
Old 06-26-2007, 09:15 PM   #4
mg92865
Member
 
Registered: Jun 2006
Distribution: Ubuntu
Posts: 35

Original Poster
Rep: Reputation: 16
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.
 
Old 06-26-2007, 09:17 PM   #5
mg92865
Member
 
Registered: Jun 2006
Distribution: Ubuntu
Posts: 35

Original Poster
Rep: Reputation: 16
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.
 
Old 06-26-2007, 09:48 PM   #6
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
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.
 
Old 06-27-2007, 08:49 AM   #7
mg92865
Member
 
Registered: Jun 2006
Distribution: Ubuntu
Posts: 35

Original Poster
Rep: Reputation: 16
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.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to modify files on hda1 using live cd pii100 Linux - Newbie 3 05-23-2006 06:31 PM
mount: can't find /dev/hda1 in /etc/fstab or /etc/mtab timalan SUSE / openSUSE 24 08-20-2005 09:41 AM
GCC on Suse Live... and access to hda1 jimsproch SUSE / openSUSE 1 02-03-2005 02:41 AM
How do I umask hda1 in knoppix? kalleanka Linux - General 0 08-16-2004 02:15 PM
KNOPPIX q's: *SwapSpace *AddSoftware *boot Iso on /dev/hda1 qwijibow Linux - Distributions 1 02-26-2004 07:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:28 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration