LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-31-2006, 10:43 AM   #1
ygloo
Member
 
Registered: Aug 2006
Distribution: slack
Posts: 323

Rep: Reputation: 30
fsck and e2fsck


i have 2 partitions - ext3 fs
rc.S - "fsck" to check on mount
"man mount" says to use "e2fsck"...
how are they different..
is it safe to switch "fsck" in rc.S to "e2fsck"?

Last edited by ygloo; 08-31-2006 at 11:00 AM.
 
Old 08-31-2006, 10:55 AM   #2
ygloo
Member
 
Registered: Aug 2006
Distribution: slack
Posts: 323

Original Poster
Rep: Reputation: 30
tune2fs 1.35 (28-Feb-2004)
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: fc82c874-90fe-11da-98f8-fa00051c2071
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal filetype needs_recovery sparse_super
Default mount options: (none)
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 1612512
Block count: 3223954
Reserved block count: 161197
Free blocks: 2978623
Free inodes: 1610411
First block: 0
Block size: 4096
Fragment size: 4096
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 16288
Inode blocks per group: 509
Last mount time: Thu Aug 31 18:02:05 2006
Last write time: Thu Aug 31 18:02:05 2006
Mount count: 23
Maximum mount count: 39
Last checked: Wed Aug 23 16:44:42 2006
Check interval: 15552000 (6 months)
Next check after: Mon Feb 19 15:44:42 2007

Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 128
Journal inode: 8
Journal backup: inode blocks

are mount count and check interval connected?
 
Old 08-31-2006, 10:58 AM   #3
ygloo
Member
 
Registered: Aug 2006
Distribution: slack
Posts: 323

Original Poster
Rep: Reputation: 30
df -
Filesystem Type Size Used Avail Use% Mounted on
/dev/hda1 ext3 5.8G 1.4G 4.1G 26% /
/dev/hda6 ext3 13G 760M 11G 7% /home
none tmpfs 189M 0 189M 0% /dev/shm
# mount -
/dev/hda1 on / type ext3 (rw,noatime)
/dev/hda6 on /home type ext3 (rw,nosuid,nodev,noatime)
none on /dev/pts type devpts (rw,gid=5,mode=666)
none on /dev/shm type tmpfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)

fdisk - hda1 -ext2 !?
 
Old 08-31-2006, 01:56 PM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,032

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Quote:
Originally Posted by ygloo
is it safe to switch "fsck" in rc.S to "e2fsck"?
Yep, provided you're using it to check and EXT2 or EXT3 filesystem. If you use e2fsck on some other filesystem type, e.g., XFS, it will report lots of errors and (probably) tell you that it doesn't think it's target filesystem is really an EXT2/EXT3 one. But you can then force it to go ahead and try to fix things anyway, which would surely be a disaster as it tries to turn an XFS filesystem into and EXT2 one!

fsck is just a frontend that calls a filesystem-specific version. So if you run fsck on an EXT2 filesystem, it will actually call fsck.ext2 (or e2fsck - same thing). Note that there is really no specific fsck for EXT3. It just uses the EXT2 version (because EXT3 is nothing more than EXT2 with an added journal - journals don't matter when fsck-ing).

You can see the filesystem-specific versions of fsck like this:
Code:
$ ls -l /sbin/*fsck*
-rwxr-xr-x  1 root root  45036 2005-04-03 05:59 /sbin/dosfsck
-rwxr-xr-x  3 root root 138348 2005-05-26 18:22 /sbin/e2fsck
-rwxr-xr-x  1 root root  18136 2005-05-26 18:22 /sbin/fsck
-rwxr-xr-x  1 root root  10616 2005-09-18 01:04 /sbin/fsck.cramfs
-rwxr-xr-x  3 root root 138348 2005-05-26 18:22 /sbin/fsck.ext2
-rwxr-xr-x  3 root root 138348 2005-05-26 18:22 /sbin/fsck.ext3
-rwxr-xr-x  1 root root  22072 2005-09-18 01:04 /sbin/fsck.minix
lrwxrwxrwx  1 root root      7 2005-10-21 10:50 /sbin/fsck.msdos -> dosfsck
-rwxr-xr-x  1 root root    413 2005-01-04 15:43 /sbin/fsck.nfs
lrwxrwxrwx  1 root root      7 2005-10-21 10:50 /sbin/fsck.vfat -> dosfsck
$
 
Old 08-31-2006, 02:14 PM   #5
ygloo
Member
 
Registered: Aug 2006
Distribution: slack
Posts: 323

Original Poster
Rep: Reputation: 30
10x, great
i don't get it why fdisk shows hda1 -ext2??

i think i formatted it as ext2 before intall OS...

Last edited by ygloo; 08-31-2006 at 02:27 PM.
 
Old 08-31-2006, 02:33 PM   #6
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,032

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Quote:
Originally Posted by ygloo
i don't get it why fdisk shows hda1 -ext2??
I don't see where you showed any fdisk output that indicates this.

fdisk output does not distinguish between EXT2 and EXT3 anyway. fdisk shows a "partition id", which is "83" for both EXT2 and EXT3 filesystems (and maybe some others as well). An ID of "82" indicates a swap partition. NTFS is "7" and FAT is "B". Note: partition id number's do not have to accurately match what's really out there. You can scramble these up if you want to, although there's usually no good reason to do that, and many bad reasons. Here's a list of various partition id numbers: http://www.win.tue.nl/~aeb/partition...n_types-1.html See my example fdisk output below:
Code:
$ sudo fdisk -l

Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1          34      273073+   b  W95 FAT32
/dev/hda2              35         799     6144862+   7  HPFS/NTFS
/dev/hda3            2272       24321   177116625    f  W95 Ext'd (LBA)
/dev/hda5            2272       22939   166015678+  8e  Linux LVM
/dev/hda6           22940       24214    10241406   8e  Linux LVM
/dev/hda7           24215       24278      514048+  82  Linux swap / Solaris
/dev/hda8           24279       24317      313236   83  Linux
/dev/hda9   *       24318       24321       32098+  83  Linux

Disk /dev/hdb: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1        6080    48837568+   5  Extended
/dev/hdb5               1        1216     9767457   8e  Linux LVM
/dev/hdb6            1217        2432     9767488+  8e  Linux LVM
/dev/hdb7            2433        3648     9767488+  8e  Linux LVM
/dev/hdb8            3649        4864     9767488+  8e  Linux LVM
/dev/hdb9            4865        6080     9767488+  83  Linux
$
 
Old 08-31-2006, 02:46 PM   #7
ygloo
Member
 
Registered: Aug 2006
Distribution: slack
Posts: 323

Original Poster
Rep: Reputation: 30
[HTML]
fdisk -l

Disk /dev/hda: 20.0 GB, 20020396032 bytes
16 heads, 63 sectors/track, 38792 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 12190 6143728+ 83 Linux
/dev/hda2 12191 38792 13407408 5 Extended
/dev/hda5 12191 13205 511528+ 82 Linux swap
/dev/hda6 13206 38792 12895816+ 83 Linux[/HTML]

Last edited by ygloo; 08-31-2006 at 02:54 PM.
 
Old 08-31-2006, 03:06 PM   #8
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,032

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Your fdisk output shows hda1 as type "83". Which includes EXT2, EXT3, Reister, etc. Here's a quote from that link I provided above regarding partition id's:

Quote:
83 Linux native partition
...
Various filesystem types like xiafs, ext2, ext3, reiserfs, etc. all use ID 83. Some systems mistakenly assume that 83 must mean ext2.
 
Old 08-31-2006, 03:19 PM   #9
ygloo
Member
 
Registered: Aug 2006
Distribution: slack
Posts: 323

Original Poster
Rep: Reputation: 30
[HTML]cfdisk -

Disk Drive: /dev/hda
Size: 20020396032 bytes, 20.0 GB
Heads: 16 Sectors per Track: 63 Cylinders: 38792

Name Flags Part Type FS Type [Label] Size (MB)
----------------------------------------------------------------------------------------------------------------------------------
hda1 Boot Primary Linux ext2 6291.22
hda5 Logical Linux swap 523.84
hda6 Logical Linux ext3 13205.35

















































[Bootable] [ Delete ] [ Help ] [Maximize] [ Print ] [ Quit ] [ Type ] [ Units ] [ Write ]


Toggle bootable flag of the current partition[/HTML]
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
e2fsck and fsck.ext3 kpachopoulos Debian 4 02-09-2006 12:29 PM
Running fsck (or e2fsck) on root file system... xbill311x Linux - Newbie 2 01-02-2006 11:54 PM
automatic fsck on boot. fsck errors. nixel Slackware 1 05-17-2004 08:51 AM
Ambiguous error messages from fsck, but not from e2fsck jiffydude Linux - Software 2 09-12-2003 07:02 PM
fsck, e2fsck, mke2fs ?'s - RH9 blackx Linux - Newbie 6 05-23-2003 03:02 PM


All times are GMT -5. The time now is 11:54 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration