LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to edit file and make read/write / on "repair filesystem" mode? (https://www.linuxquestions.org/questions/linux-general-1/how-to-edit-file-and-make-read-write-on-repair-filesystem-mode-621532/)

tovohery 02-16-2008 12:19 AM

How to edit file and make read/write / on "repair filesystem" mode?
 
Due to mistake change /etc/fstab. When Redhat AS 4.4 bootup, it stop in middle and asked me login as "root" to fix it.

when I tried to vi /etc/fstab, it show "read ONLY". I can NOT change it. does there has way to edit file on "repair filesystem" mode and make the / mount point read/write

Thanks.

jschiwal 02-16-2008 01:22 AM

Boot up in the rescue mode and try to mount the partition manually.

tovohery 02-16-2008 02:35 AM

i'm new with linux, here is the result of df-k and fdsik.

#df –k
Filesystem 1K-blocks Used Available use% Mounted on
Roots 7163 5325 1429 79% /
/dev/root.old 7163 5325 1429 79% /
/tmp/loop0 187072 187072 0 100% /mnt/runtime

#fdisk –l /dev/sda

Disk /dev/sda: 161.0GB

Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 514048+ 83 Linux
/dev/sda2 65 3251 25599577+ 82 Linux swap
/dev/sda3 3252 19581 120929287+ 5 Extended

Could you tell me how to mount manually /dev/sda3?

Thanks in advance

jschiwal 02-17-2008 03:35 PM

It looks like that is the extended partition. There doesn't seem to be any partitions created inside it.
[code]
/dev/sda1 * 1 3786 30409287 7 HPFS/NTFS
/dev/sda2 3787 3982 1574370 82 Linux swap / Solaris
[code]/dev/sda3 3983 12161 65697817+ f W95 Ext'd (LBA)[code]
/dev/sda5 3983 4635 5245191 83 Linux
/dev/sda6 4636 12161 60452563+ 83 Linux
[code]

Furthermore, the partition type isn't a mountable partition. It looks like the partition table has been corrupted and is missing an entry or the type byte is wrong. It may be fixable if the partition itself is OK.

A) If the type byte is wrong you could change the type of /dev/sda3. If Redhat AS 4.4 configures it's filesystem with /boot, swap and an lvm volume, change the type to "df".
B) If there should be another entry for a partition inside the extended partition, then you can simply create it in fdisk.
The start should be 4636 and the end should be 12161. The type again probably should be "df". After writing back the partition try running "lvmdiskscan" or "vgscan" and see if they find it.
C) What does /etc/fstab show for the root partition? The LVM partition is a volume which itself may contain partitions.

archtoad6 02-17-2008 05:54 PM

"Code:" blocks
 
tovohery,
Learn to use "Code:" blocks for command output. Use the '#' button above the text input box in "Post Reply" or "Advanced Mode". It will preserve the spacing/formatting of the output you are posting.

jschiwal,
Would you mind fixing your "Code:" block(s), there are no closing '[/code]' tags, so I don't know what goes where & can't understand what point you are trying make in it/them.

tovohery 02-18-2008 01:39 AM

I fix the problem now. I just use the repair system mode and recreate the fstab manually to mount the partition that store the backup file and then restart the system in rescue mode and restore all the files needed in the backup partition.
Thanks.

Regards


All times are GMT -5. The time now is 02:22 AM.