Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
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 ...
  1. #1
    Just 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

  2. #2
    Linux 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"

  3. #3
    Just 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

  4. #4
    Linux 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.

    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.
    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.

  5. #5
    Just 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,
    Jon
    Last edited by JonBL; 10-02-2010 at 07:26 AM.

  6. #6
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    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.
    Code:
    su -
    /sbin/fdisk -l
    Let say, it's /dev/sda1.

    Execute this
    Code:
    su -
    mkdir /media/sda1
    mount -t ext3  /dev/sda1  /media/sda1
    nano /media/sda1/etc/fstab
    Edit and save file. Execute umount /dev/sda1 command and reboot machine.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  7. #7
    Just 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

  8. #8
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    2,941
    Suggest you boot from the hard drive and post the output of
    Code:
    mount
    also post the output of
    Code:
    blkid
    run as root so we can see partition information ...

  9. #9
    Just 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. #10
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    2,941
    Quote Originally Posted by JonBL View Post
    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.
    1. should be
    2. depends if usb drive information conflicts with other partition information, cat /etc/fstab and blkid output may help us answer why you had problems.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...