LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   broke fstab somehow (https://www.linuxquestions.org/questions/linux-newbie-8/broke-fstab-somehow-4175460218/)

billstowell 04-30-2013 08:32 PM

broke fstab somehow
 
Any help with this problem would be appreciated.

I was messing with my LMDE13 laptop and somehow lost the automount for an inserted usb stick. Now that I look at the fstab it looks like I won't be able to mount a cd either.

Here is my /etc/fstab file:

bill@bill-ThinkPad-R61 ~ $ 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>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=35da9417-8f3a-4a8d-9012-508e5483ca79 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=403fff08-7b6b-43bd-a6ab-b581568ef2fe none swap sw 0 0

bill@bill-ThinkPad-R61 ~ $


It looks to me like I need to add a line for usb devices and a line for my CD/DVD drive.

What is the syntax for those lines? the usb is: /dev/sdb

bill@bill-ThinkPad-R61 /dev $ ls -l sd*

brw-rw---- 1 root disk 8, 0 Apr 28 19:04 sda ----sda is my harddrive
brw-rw---- 1 root disk 8, 1 Apr 28 19:04 sda1
brw-rw---- 1 root disk 8, 2 Apr 28 19:04 sda2
brw-rw---- 1 root disk 8, 5 Apr 28 19:04 sda5
brw-rw---- 1 root disk 8, 16 Apr 30 20:57 sdb
brw-rw---- 1 root disk 8, 17 Apr 30 20:57 sdb1



the cd is: /dev/cdrom

bill@bill-ThinkPad-R61 /dev $ ls -l cd*

lrwxrwxrwx 1 root root 3 Apr 28 19:04 cdrom -> sr0
lrwxrwxrwx 1 root root 3 Apr 28 19:04 cdrw -> sr0

bill@bill-ThinkPad-R61 /dev $

Did I somehow erase part of my fstab? and if I did, how can I fix it?

thanks

Bill Stowell

flos 04-30-2013 09:17 PM

Dear Bill,
you don't say which flavour of Linux you are using.
But, in any case, I wouldn't expect a USB drive to appear under /mnt. Most linux distros would mount USBs and CDs under /media. I'm a noooby myself, so I can't dive into what the problem actually is. The /etc/fstab file is generally used for permanent mounts, anyway.
Also, I prefer the LABEL=<disc_label> method. If you have to reformat a drive, its UUID may well change, but you can always keep the LABEL the same, manually.
I'm using Ubuntu 12.10, and I find Disk Utility under Applications -> Accessories. There, you find the capability to mount and unmount volumes.
In my version of Linux, plugging in a USB device automatically brings up a Nautilus (file explorer) window, which tells me that the device has been detected, and where it has been mounted.
I've never used USB devices as part of my standard system, so that's as far as I can help.
But I would seriously consider using the LABEL= syntax, because if you keep your USB sticks organised, and labelled, you never have any hard work to do.
Best of luck, and do tell us how you get on with this.
Flos

billstowell 05-01-2013 08:18 AM

re broke fstab somehow
 
Hi Fios,

Thank you for your reply. My version of linux is Linux Mint Debian 13 (LMDE 13). Until I broke the fstab (or whatever it was that I broke), a usb drive or cd would show up immediately as a file.

Now not only does a drive not open immediately, but I have not been able to mount the drive using the mount command. I thought that the fstab would have a reference of some sort for usb and cdrom, but I don't see one. So, I thought that the problem was caused by a broken fstab.

Any thoughts are appreciated

Bill

273 05-01-2013 09:30 AM

I don't think your problem will be fstab if you're using LMDE with a desktop environment -- I'm running Debian and I don't have any entries in fstab for my USB or DVD drive[s]* yet they show up in XFCE and are mountable from the places menu.
When you plug in a device do you see anything appear in your file manager?

*not completely true, there was an entry mounting /dev/sda1 as a USB device but I commented it out since /dev/sda is always an internal hard drive and the USB drive is generally /dev/sdi. This hasn't affected USB mounting in any way I just did it for "neatness".


All times are GMT -5. The time now is 08:51 AM.