Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-09-2012, 05:45 AM
|
#1
|
LQ Newbie
Registered: Aug 2012
Posts: 4
Rep: 
|
fsck and fstab explanation sought
We use drbd and I need to fsck the drbd volume. I thought I new the drbd partition name but looking in fstab it did not appear. I could not mount it. I tried fsck and that was able to see the partition.
The fsck manual says it looks in fstab but it must be looking somewhere else to find partitions. Where does it look? There is an entry in /dev/disk/by-id for this partition. Is fsck looking there?
A secondary question is whether I need to fsck the Secondary drbd image on the other server, as well, but I am still investigating that.
Last edited by nickhoare; 08-10-2012 at 04:14 AM.
Reason: Make title more relevant to thread
|
|
|
08-09-2012, 09:56 AM
|
#2
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
Exactly what command line did you type that did the fsck of the device? What output did you get that tells you it did the fsck of the one you're interested in? (That is did you type just "fsck" or "fsck -A" or "fsck /dev..."?)
With fsck you can specify the device to check so would not need to read /etc/fstab if you did this. (In fact this is the most common usage at command line - most fsck's are done at boot instead.)
After a filesystem is mounted it appears in /etc/mtab (this file should NOT be edited manually).
However, in general it is a bad idea to run an fsck on a mounted filesystem - you should first unmount it.
|
|
1 members found this post helpful.
|
08-09-2012, 11:46 AM
|
#3
|
LQ Newbie
Registered: Aug 2012
Posts: 4
Original Poster
Rep: 
|
I typed fsck -n /dev/sda9 . I was unable to mount using "mount /dev/sd9" but have since discovered that "mount /dev/sda9 /mnt" works I presume because I am telling mount where to mount it and so it can manage without an entry in fstab?
My understanding of fstab is now that it is a list of normally mounted partitions (filesystems?), used e.g on boot, whereas I originally thought it was a list of all available partitions. /etc/mtab has a list of currently mounted partitions . There may be other partitions not appearing in fstab. All partitions can be found in /dev/disk ?
I think fsck warns about mounted filesystems. I was able to run fsck on my unmounted volume and repair it. There is now a mass of files in a folder lost+found yet everything works, which is disconcerting.
Thanks for your help
|
|
|
08-09-2012, 01:04 PM
|
#4
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
The mount (and umount) commands will read /etc/fstab to find information you didn't supply at command line. If you had the entry in /etc/fstab for /dev/sda9 to mount it somehwere (e.g /mnt) and also had any filesystem specific options in that file then when you typed "mount /mnt" it would read fstab and know you meant to mount /dev/sda9 as /mnt and also use any options you'd put in fstab as if you'd typed them with the mount command.
Of course typically you wouldn't want to use "/mnt" by itself in /etc/fstab. Not that you can't but that it would not be coventional - people typically use /mnt (or subdirectories thereof) for temporary mounts. If you're putting it in /etc/fstab you should probably create a mount point (empty directory) to mount it. For example if you wanted to access the files on /dev/sda9 in a directory called /my/long/mount/path/mydir and it was an ext4 filesystem you'd:
1) mkdir -p /my/long/mount/path/mydir
2) Add the entry to /etc/fstab that looked something like:
/dev/sda9 /my/long/mount/path/mydir ext4 defaults,_netdev 1 3
3) Type "mount /my/long/mount/path/mydir" to mount it.
If you do ls -l of mydir before the mount you'll see it is empty. After the mount it will have any files you put in it.
As a test you could write to the mount you did in /mnt then do umount /mnt then do the above steps and you'll see the files that were previously in /mnt are now in mydir.
/etc/fstab is read during boot to mount any filesystem that you want to mount statically and automatically. (There is a separate setup called automount in the /etc/auto* files for mounting filesystems on demand temporarily.)
Last edited by MensaWater; 08-10-2012 at 09:07 AM.
|
|
|
08-09-2012, 09:33 PM
|
#5
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,426
|
All of the above & in short:
Code:
# show all disks/partitions the system can see
fdisk -l # lowercase L
# disk/partitions you would LIKE mounted at boot time
cat /etc/fstab
# disks/partitions ACTUALLY currently mounted
cat /etc/mtab
# automount in the /etc/auto* files for mounting filesystems on demand temporarily (MensaWater)
ls /etc/auto*
HTH
|
|
|
08-10-2012, 04:21 AM
|
#6
|
LQ Newbie
Registered: Aug 2012
Posts: 4
Original Poster
Rep: 
|
Thanks for the clear succinct explanation guys. I do RTFM but man documents do not give overviews like yours. And knowing what to google can be a problem if you don't know the terminology.
|
|
|
08-10-2012, 09:17 AM
|
#7
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
Quote:
Originally Posted by nickhoare
knowing what to google can be a problem if you don't know the terminology.
|
You think it is bad in Google! When I first started working on computers one had to rely on actual books (manuals). The first time I needed the database concept of "outer join" I had no clue it was called that and ended up having to read most of an Informix manual just to find that was what it was called. I knew such a concept existed because I'd previously used Paradox to join tables but they didn't call it that. Informix manuals had the worst INDEXES of any manuals I've ever come across which is somewhat ironic given how important INDEXES are to a DBMS.
When I was in school (not long after the dinosaurs roamed the earth) they regularly taught us how to search for books in card catalogs and how to find information in them in indexes in the back of the books and various other ways to find information from periodicals and such. With the advent of web searches I wonder if they bother teaching that any longer.

|
|
|
08-10-2012, 11:18 AM
|
#8
|
LQ Newbie
Registered: Aug 2012
Posts: 4
Original Poster
Rep: 
|
Mensa, I remember the days of Technical Manuals! I may have been trying to disguise myself as a youngster, but in fact I carry a lot of historical baggage from DEC VMS, DBMS, ORACLE, through Windows, Netware, VB, SQL Server, ASP.NET and now have lumbered myself with something else new. Did I mention Delphi, C++ and dBase?
At least with manuals you only had one place to look.....
|
|
|
08-10-2012, 12:03 PM
|
#9
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
Ah dBase II I remember it well but not fondly. Paradox was a superior product until Borland merged dBase and Paradox together to make them indistinguishable later. Funny thing about dBase II - There never was a dBase I - they named it II to make it sound more advanced. Up until M$ started giving away Access most folks with PCs who needed a DB used dBase or Paradox (or some other oddities like Foxpro).
When I first started working on PCs it was the original IBM PC with 4.7 MHz processor, DOS 2.0 and Lotus 123 v1.A. DOS 2.0 was fun because if you were sitting on your C drive and typed "format" it didn't ask if you really meant to format C - it just went ahead and did it. D'oh!
Oddly enough I've worked with IBM System 34/36, NetWare, multiple flavors of UNIX (including odd ones like Qnix, Apple's early one called A/UX, Dynix and DEC's Astrix. Despite that the only place I ever saw the Alphas was at my present job and they decommissioned them shortly after I got here. As common as they were it always amazed me I never seemed to be anywhere where they were.
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 05:57 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|