Linux - NewbieThis 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!
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.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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 03:14 AM.
Reason: Make title more relevant to thread
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.
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.
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 08:07 AM.
# show all disks/partitions the system can see
fdisk -l # lowercase L
# disk/partitions you would LIKE mounted at boot time
# disks/partitions ACTUALLY currently mounted
# automount in the /etc/auto* files for mounting filesystems on demand temporarily (MensaWater)
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.
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.....
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.