Find the answer to your Linux question:
Results 1 to 4 of 4
Hello. I haven't posted anything here in some time (I've actually been a linux user for around 8 years now and I'm normally able to figure these problems out) but ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    kbk
    kbk is offline
    Linux User kbk's Avatar
    Join Date
    Jun 2005
    Location
    Ohio, USA
    Posts
    361

    Bad line in fstab


    Hello. I haven't posted anything here in some time (I've actually been a linux user for around 8 years now and I'm normally able to figure these problems out) but I'm having a problem that I can't seem to figure out. I'm posting it here in the newbie section because I'm sure it's a stupid mistake and I just can't figure it out.

    I added some lines to /etc/fstab to mount my 2 internal hard drives. Everything was working fine then one time I rebooted it started telling me that the lines are bad and it will not mount the drives automatically anymore. I have to comment out the lines and then I am able to mount the drive by selecting it from Dolphin and entering my root password when prompted.

    Here is my /etc/fstab:
    Code:
    $ cat /etc/fstab
    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    # / was on /dev/sda5 during installation
    UUID=2bd9de55-4845-446f-a55b-8dd4ca50d3a2 /               ext4    errors=remount-ro 0       1
    # swap was on /dev/sda6 during installation
    UUID=4abcf590-42c6-47b3-a407-d48e7b89d7a4 none            swap    sw              0       0
    /dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
    
    #1.5tb
    UUID=7cdc02ea-734f-4af2-ba93-939a076b9d0a /dev/sdc1    /mnt/sdc        ext4    defaults        0  0
    #1tb
    UUID=cf433cf8-fa6e-45f0-a04b-e85c55afccfd /dev/sdb1    /mnt/sdb        ntfs-3g defaults        0  0
    Now the drive will mount if I click on it from within Dolphin and enter my root password. Here is the output of fdisk -l (with one of the drives mounted):

    Code:
    $ sudo fdisk -l
    
    Disk /dev/sdb: 750.2 GB, 750156374016 bytes
    255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x000b5bd9
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
    /dev/sdb2          206848   167774207    83783680    7  HPFS/NTFS/exFAT
    /dev/sdb3       167776254  1465147391   648685569    5  Extended
    /dev/sdb5       167776256  1431683071   631953408   83  Linux
    /dev/sdb6      1431685120  1465147391    16731136   82  Linux swap / Solaris
    
    Disk /dev/sda: 1000.2 GB, 1000203804160 bytes
    255 heads, 63 sectors/track, 121601 cylinders, total 1953523055 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0009d24f
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1            2048  1953521663   976759808    7  HPFS/NTFS/exFAT
    
    Disk /dev/sdc: 1500.3 GB, 1500301910016 bytes
    255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00036e39
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1              63  2930272064  1465136001   83  Linux
    Partition 1 does not start on physical sector boundary.
    Please let me know what I've done to cause this and how to fix it. If you need any additional info please let me know and I will provide it. Thank you for any/all assistance.

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,110
    The entries I have in fstab either have the device (/dev/sdb1) or the UUID, not both. I would delete the dev entry for each and try that. If that doesn't help, it's easy enough to change back.

  3. #3
    kbk
    kbk is offline
    Linux User kbk's Avatar
    Join Date
    Jun 2005
    Location
    Ohio, USA
    Posts
    361
    Quote Originally Posted by yancek View Post
    The entries I have in fstab either have the device (/dev/sdb1) or the UUID, not both. I would delete the dev entry for each and try that. If that doesn't help, it's easy enough to change back.
    That was it! I had never used UUID to set up my drives before so I think I was just a bit confused. Thanks so much!

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    11,167
    I usually label my file systems so if the OS changes the dev entry name, then they will still be mounted properly. This is good when you have to clone a drive because it may be starting to fail - the label is associated with the file system you are cloning, whereas the UUID is associated with the partition and it will change on the new hardware (at least that has happened to me in the past). So, once the file system is labeled (you can also label swap partitions), you can do this in your fstab:
    Code:
    # old mount info
    UUID=fba2424b-6716-441a-bb64-645511213148 /boot                   ext4    defaults        1 2
    # new mount info
    LABEL=boot                                /boot                   ext4    defaults        1 2
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

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