Results 1 to 10 of 14
I've edited /etc/fstab to auto-mount two partitions on a new disk drive that have been formatted as ext3, by appending the following two lines:
/dev/sdb1 /bak1 ext3 defaults 1 1
...
- 10-02-2010 #1Just Joined!
- Join Date
- Dec 2006
- Posts
- 19
[SOLVED] Cant Boot After Changing /etc/fstab
I've edited /etc/fstab to auto-mount two partitions on a new disk drive that have been formatted as ext3, by appending the following two lines:
/dev/sdb1 /bak1 ext3 defaults 1 1
/dev/sdb2 /bak2 ext3 defaults 1 1
On reboot, the system complains there is some problem (I can't advise what the problem is, because the display scrolls up too fast to read!), and I'm left with a root command prompt.
Its a /etc/fstab problem, presumably. I've used vi to edit /etc/fstab to remove the two lines mentioned above, but on quit and save, I'm told I have a read-only file system!
Two questions:
1. How can I mount a read-write file system so I can edit /etc/fstab?
2. What's wrong with my two new entries in /etc/fstab? After formatting /dev/sdb1 and /dev/sdb2, I checked the they were mountable with # mount /dev/sdbn /bakn (n = 1, 2) before editing fstab.
TIA,
Jon
- 10-02-2010 #2Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
1) Boot from a LiveCD, mount your original root drive, and edit the fstab.
2) Who knows.
- Is the new HDD internal? Maybe after a reboot the new drive is being detected first and has become /dev/sda instead of sdb - which depending on your fstab setup will prevent the boot process.
- Use a "tab" between the columns in fstab.
- For the last column in fstab, use a 2. Read "man fstab"
- 10-02-2010 #3Just Joined!
- Join Date
- Dec 2006
- Posts
- 19
Thanks HRO.
I recall reading a thread a couple of years ago, which provided instructions on how to mount a read-write FS in this situation, to allow editing of fstab. But I can't find it, again... I'll try your LiveCD suggestion.
The new disk is external, connected by USB.
Regards,
Jon
- 10-02-2010 #4Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
You are referring to the mount option "remount,rw" - I didn't suggest it because you may see mixed results. The LiveCD method will always work.
The drive is USB? If the USB driver hasn't initialized and found the external drive during boot, then the boot process will choke because /dev/sdb doesn't exist. You may want to pull sdb from the fstab and have a small script that mounts it later in the boot process.Code:man mount remount Attempt to remount an already-mounted file system. This is commonly used to change the mount flags for a file system, especially to make a readonly file system writeable. It does not change device or mount point.
- 10-02-2010 #5Just Joined!
- Join Date
- Dec 2006
- Posts
- 19
Thanks, HRO.
I've started my problem F10 box with a F11 Live CD boot, but when I
# more /etc/fstab
I'm seeing a completely different fstab from the one I'm trying to fix. I note your comment to "mount your original root drive" - I've used # mount -t ext3 /dev/sda1 /, but this complains "special device /dev/sda1 does not exist". Can you elaborate on what I need to do to find my original fstab?
Your comment about the the usb driver not being loaded in time makes sense - but in the meantime, I've got to fix my fstab!
TIA,
JonLast edited by JonBL; 10-02-2010 at 07:26 AM.
- 10-02-2010 #6
You have to mount / partition in Fedora LiveCD and edit it's /etc/fstab file. Execute fdisk -l command and note down device name assigned to / partition.
Let say, it's /dev/sda1.Code:su - /sbin/fdisk -l
Execute this
Edit and save file. Execute umount /dev/sda1 command and reboot machine.Code:su - mkdir /media/sda1 mount -t ext3 /dev/sda1 /media/sda1 nano /media/sda1/etc/fstab
It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First
- 10-02-2010 #7Just Joined!
- Join Date
- Dec 2006
- Posts
- 19
Thanks, DC.
# fdisk -l does not tell me what is assigned to the / partition, but df -h does say that /dev/mapper/VolGroup00-LogVol00 is mounted on /.
Also, mkdir does not allow me to create any directories - "cannot create directory /media/sda1: Read-only file system".
Jon
- 10-02-2010 #8
Suggest you boot from the hard drive and post the output of
also post the output ofCode:mount
run as root so we can see partition information ...Code:blkid
- 10-02-2010 #9Just Joined!
- Join Date
- Dec 2006
- Posts
- 19
solved
This problem fixed:
# mount -n -o remount /
# vi /etc/fstab
I was able to save the edited fstab, and reboot. I'll now research alternative ways to mount my two new file systems.
A couple of questions occur to me, though:
1. Surely it's not impossible for the boot process to load the required USB driver before mounting disks via /etc/fstab?
2. Why should the boot process crash just because it can't mount my external USB drive? If it can mount my internal drive, isn't that adequate under this circumstance. It would have been simple to then fix the fstab issue.
Regards,
Jon
- 10-03-2010 #10



