LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-28-2022, 04:32 AM   #1
masber
LQ Newbie
 
Registered: Apr 2019
Posts: 7

Rep: Reputation: Disabled
cannot mount through fstab


Dear linux community,

I am trying to mount a ceph rbd device into a linux machine.

Code:
nid001402:~ # parted -l
Model: Unknown (unknown)
Disk /dev/rbd0: 322GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags: 

Number  Start  End    Size   File system  Flags
 1      0.00B  322GB  322GB  ext4
This is my /etc/fstab file:

Code:
# Added by Shasta dracut module
/dev/rbd0 /scratch/local ext4 default 0 0
I can mount the device through command line:

Code:
nid001402:~ # mount -t ext4 /dev/rbd0 /scratch/local
nid001402:~ # df | grep rbd
/dev/rbd0      308587328   65564 292776740   1% /scratch/local
I then umount and try to mount based on fstab:

Code:
nid001402:~ # umount /scratch/local 
nid001402:~ # mount -t ext4 -a
mount: /scratch/local: wrong fs type, bad option, bad superblock on /dev/rbd0, missing codepage or helper program, or other error.
I am unsure of this behaviour, could someone please give me a hint of what is happening and how to solve this?

thank you very much

Last edited by masber; 06-28-2022 at 04:45 AM.
 
Old 06-28-2022, 04:36 AM   #2
suramya
Member
 
Registered: Jan 2022
Location: Earth
Distribution: Debian
Posts: 249

Rep: Reputation: 102Reputation: 102
I don't think you need to add the '-t ext4' to the mount -a command, since you are already specifying the filesystem in the /etc/fstab. Can you try it without it?
 
Old 06-28-2022, 04:44 AM   #3
masber
LQ Newbie
 
Registered: Apr 2019
Posts: 7

Original Poster
Rep: Reputation: Disabled
also fails without the fs type

Code:
nid001402:~ # mount -a
mount: /scratch/local: wrong fs type, bad option, bad superblock on /dev/rbd0, missing codepage or helper program, or other error.
 
Old 06-28-2022, 05:19 AM   #4
suramya
Member
 
Registered: Jan 2022
Location: Earth
Distribution: Debian
Posts: 249

Rep: Reputation: 102Reputation: 102
Hmm... What do the logs say? Check the dmesg log after running the Mount command
 
Old 06-28-2022, 05:28 AM   #5
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,345

Rep: Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588
What does
Code:
fdisk -l
show
 
Old 06-28-2022, 05:39 AM   #6
masber
LQ Newbie
 
Registered: Apr 2019
Posts: 7

Original Poster
Rep: Reputation: Disabled
ok, tried strace and found this

Code:
access("/run/mount", R_OK|W_OK)         = 0
mount("/dev/rbd0", "/scratch/local", "ext4", 0, "default") = -1 EINVAL (Invalid argument)
open("/usr/share/locale-langpack/en_US.UTF-8/LC_MESSAGES/util-linux.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
edited fstab to

Code:
/dev/rbd0 /scratch/local ext4 noauto 0 0
and now I can run mount -a

not sure the difference between nauto and default ...
 
Old 06-28-2022, 06:09 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,679

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
The correct syntax is defaults not default. From man mount:
Quote:
defaults
Use default options: rw, suid, dev, exec, auto, nouser, async, and relatime.

Last edited by michaelk; 06-28-2022 at 06:59 AM.
 
Old 07-01-2022, 08:15 AM   #8
Lnthink
Member
 
Registered: May 2010
Location: Lafayette, LA
Distribution: Ubuntu, RH, Fedora
Posts: 44

Rep: Reputation: 11
I think all that's missing is that you didn't format the filesystem before you tried to mount it.
#> mkfs.ext4 /dev/rdb0
#> mkdir /scratch/local -- you probably already did this

-- ALSO change the word in fstab that says "default" to "defaults".

then you should be able to mount it.
#> mount -a
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Linux NFS Mount Entry in fstab (/etc/fstab) with Example LXer Syndicated Linux News 0 06-17-2022 09:55 AM
Cannot mount NFS share (Fstab special character at the end of the mount) meki Linux - Newbie 3 01-06-2016 01:22 PM
Cannot mount NFS share (Fstab special character at the end of the mount) meki Linux - Newbie 3 01-01-2016 10:19 AM
fstab problem: mount: can't find dvd in /etc/fstab or /etc/mtab Nikon01 Slackware 5 11-17-2006 06:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration