Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Wed Dec 06, 2023 8:59 am


System administration, processes administration, jobs, cron, resources, limits, shells, ssh, telnet.

Author Message
mandrei99
Post  Post subject: How to read UFS filesystem super block information in FreeBSD  |  Posted: Mon Jul 22, 2013 9:52 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 250

Offline
 

How to read UFS filesystem super block information in FreeBSD

How to read UFS filesystem super block information in FreeBSD

Use the dumpfs utility (by default in FreeBSD). Quote from man:
Quote:
# man dumpfs
DUMPFS(8) FreeBSD System Manager's Manual DUMPFS(8)

NAME
dumpfs -- dump UFS file system information

SYNOPSIS
dumpfs [-f] [-l] [-m] filesys | device

DESCRIPTION
The dumpfs utility prints out the UFS super block and cylinder group
information for the file system or special device specified, unless the
-f, -l or -m flag is specified. The listing is very long and detailed.
This command is useful mostly for finding out certain file system infor-
mation such as the file system block size and minimum free space percent-
age.

If -f is specified, a sorted list of all free fragments and free fragment
ranges, as represented in cylinder group block free lists, is printed.
If the flag is specified twice, contiguous free fragments are not col-
lapsed into ranges and instead printed in a simple list. Fragment num-
bers may be converted to raw byte offsets by multiplying by the fragment
size, which may be useful when recovering deleted data.

If -l is specified, the pathname to the file system's container derived
from its unique identifier is printed.

If -m is specified, a newfs(8) command is printed that can be used to
generate a new file system with equivalent settings.

SEE ALSO
disktab(5), fs(5), disklabel(8), fsck(8), newfs(8), tunefs(8)

HISTORY
The dumpfs utility appeared in 4.2BSD.

FreeBSD 9.1 Jul 14, 2011 FreeBSD 9.1



Reading /var filesystem superblock information with dumpfs:
Code:
# dumpfs /var | less
magic   19540119 (UFS2) time    Mon Jul 22 13:50:48 2013
superblock location     65536   id      [ 4fa661e4 f7c0aa2c ]
ncg     20      size    3670016 blocks  3610471
bsize   32768   shift   15      mask    0xffff8000
fsize   4096    shift   12      mask    0xfffff000
frag    8       shift   3       fsbtodb 3
minfree 8%      optim   time    symlinklen 120
maxbsize 32768  maxbpg  4096    maxcontig 4     contigsumsize 4
nbfree  205903  ndir    44112   nifree  643408  nffree  55447
bpg     23680   fpg     189440  ipg     47360   unrefs  0
nindir  4096    inopb   128     maxfilesize     2252349704110079
sbsize  4096    cgsize  32768   csaddr  3000    cssize  4096
sblkno  24      cblkno  32      iblkno  40      dblkno  3000
cgrotor 13      fmod    0       ronly   0       clean   0
avgfpdir 64     avgfilesize 16384
flags   soft-updates+journal
fsmnt   /
volname         swuid   0       providersize    0

cs[].cs_(nbfree,ndir,nifree,nffree):
        (3644,102,44949,1494) (21376,261,44596,3772) (16132,3770,29881,3797) (18437,1371,40690,7041)
        (10937,1835,30612,17343) (12519,985,37439,2427) (19055,25,46948,633) (12,1450,28024,2792)
        (533,3024,30662,2020) (1043,459,32951,2339) (5271,698,16416,568) (4844,4157,24950,73)
        (6822,4462,25282,1688) (17383,329,43333,2771) (19817,1245,36241,1832) (20501,2313,34224,2367)
        (14562,4447,23975,701) (7377,4332,24014,397) (2475,4562,21280,847) (3163,4285,26941,545)
blocks in last group 8832


cg 0:
magic   90255   tell    20000   time    Wed Jul  3 13:34:44 2013
cgx     0       ndblk   189440  niblk   47360   initiblk 47360  unrefs 0
nbfree  3644    ndir    102     nifree  44949   nffree  1494
rotor   26224   irotor  5       frotor  11792
frsum   158     144     62      54      45      48      19
sum of frsum: 1494
clusters 1-3:   37      18      11
....

Rest of the output is ommited to keep the post short.





Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "How to read UFS filesystem super block information in FreeBSD"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. How to print filesystem super block information in Linux

mandrei99

0

14105

Mon Jul 08, 2013 6:56 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to get UFS filesystem block size in FreeBSD

mandrei99

0

4946

Mon Jul 22, 2013 9:49 am

mandrei99 View the latest post

There are no new unread posts for this topic. MAC OS X: read image/jpeg EXIF information on command line

admin

0

6062

Mon Sep 11, 2017 8:52 am

admin View the latest post

There are no new unread posts for this topic. FreeBSD - fuser checking processes that are using a filesystem

mandrei99

2

3742

Tue Mar 24, 2015 1:26 am

Woolmer View the latest post

There are no new unread posts for this topic. FreeBSD - How to retrieve the newfs command that was used to create an existing UFS filesystem

mandrei99

0

2398

Mon Jul 22, 2013 9:55 am

mandrei99 View the latest post

There are no new unread posts for this topic. Linux: list block devices UUID

debuser

0

3708

Tue Mar 10, 2015 5:46 pm

debuser View the latest post

There are no new unread posts for this topic. Linux network interface pci slot information - lspci / Intel or Broadcom

mandrei99

0

11503

Fri Jan 16, 2015 7:58 pm

mandrei99 View the latest post

There are no new unread posts for this topic. How to list PCI devices in FreeBSD - pciconf

mandrei99

0

17158

Mon Jul 22, 2013 9:58 am

mandrei99 View the latest post

There are no new unread posts for this topic. Squid clear cache on FreeBSD

mandrei99

0

4061

Mon Mar 03, 2014 7:37 am

mandrei99 View the latest post

There are no new unread posts for this topic. FreeBSD slow booting: Recovering vi editor sessions

mandrei99

0

3218

Wed Feb 19, 2014 4:02 pm

mandrei99 View the latest post

 

Who is online
Users browsing this forum: No registered users and 1 guest
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
News News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO