cancel
Showing results for 
Search instead for 
Did you mean: 

How to find initial filesystem size

Qamar_Vakil
Level 2

How can I find the initial size of a filesystem i.e. when it was created. Is there any fsdb or fstyp option for it

1 ACCEPTED SOLUTION

Accepted Solutions

ScottK
Level 5
Employee

For example, on one system, below.

The first entry will probably be mkfs, unless you had an older file system that was upgraded. Correspondingly, if you have an older file system there may be no mkfs entry to get this.

I'm not a histlog expert, but the type corresponds to the activity type. The timestamp on the next line seems straightforward. The 3rd line shows the file system disklayout version (7), the size of the intent log (in file system blocks), the file system size at creation time (almost certainly in file system blocks) and the number of 'devices' aka volumes (since VxFS can comprise multiple volumes). To convert from file system blocks, you need to get the block size (i.e., via mkfs -m) and multiply.

As a sanity check, you can look at the resize operations. Each resize entry lists the old size in file sytsem blocks (oblks) and the new size in file system blocks (nblks).

root@test01</>$ echo "histlog" | fsdb -F vxfs /dev/vx/dsk/datadg/exportvset
type 10000  "mkfs"
time 1190939301 821803 (Fri Sep 28 08:28:21 2007 GMT-8)
version 7  logsize 65536  fssize 253403070464 fsndevs 1

type 10007  "resize"
time 1247176021 840885
kernel VxFS 5.0_REV-s_5_0x86A12_sol SunOS 5.10
oblks 247463936  nblks 247463935
devid 0
 

View solution in original post

8 REPLIES 8

Gaurav_S
Moderator
Moderator
   VIP    Certified

Did you see " mkfs -m <raw_device>"  ?

 

From man pages of mkfs

 -m    Return the command line which was used to  create  the
           file  system. The file system must already exist. This
           option provides a means  of  determining  the  command
           used in constructing the file system.

 

Not sure of an equivalent fsdb option..
 

Gaurav

kunal
Level 4
Employee

Hi,

 

try this:

 

echo "histlog" | fsdb -F vxfs /dev/vx/dsk/<dg>/<vol>

 

Gaurav_S
Moderator
Moderator
   VIP    Certified

I am getting old :) ...

Dev_Roy
Level 6
Accredited Certified

You can try:

 

fstyp -v /dev/vx/dsk/<dg>/<vol>

 

lookout for "ctime" ( creation time ) that means when the filesystem was created.

 

# fstyp -v /dev/vx/dsk/testdg/testvol
vxfs
magic a501fcf5  version 7  ctime Mon 27 Apr 2009 06:42:05 AM IST

-----output truncated-----

You will observe lot of other details pertaining to file system including file system size in blocks etc...

 

Regards.

Dev

Qamar_Vakil
Level 2

mkfs pm gives me how i can recreate the filesystem based on the currect configuration. What i am looking for is the history on the file system, for example f/s was initially created as say 2 Gb, then expanded by 100 GB and then another 200 GB

Qamar_Vakil
Level 2

One more further question, apologize if it is a basic one. Do you know to read the output or is something Symantec can only, for example my output shows

type 10000  "mkfs"
time 1131980899 126952
 

ScottK
Level 5
Employee

For example, on one system, below.

The first entry will probably be mkfs, unless you had an older file system that was upgraded. Correspondingly, if you have an older file system there may be no mkfs entry to get this.

I'm not a histlog expert, but the type corresponds to the activity type. The timestamp on the next line seems straightforward. The 3rd line shows the file system disklayout version (7), the size of the intent log (in file system blocks), the file system size at creation time (almost certainly in file system blocks) and the number of 'devices' aka volumes (since VxFS can comprise multiple volumes). To convert from file system blocks, you need to get the block size (i.e., via mkfs -m) and multiply.

As a sanity check, you can look at the resize operations. Each resize entry lists the old size in file sytsem blocks (oblks) and the new size in file system blocks (nblks).

root@test01</>$ echo "histlog" | fsdb -F vxfs /dev/vx/dsk/datadg/exportvset
type 10000  "mkfs"
time 1190939301 821803 (Fri Sep 28 08:28:21 2007 GMT-8)
version 7  logsize 65536  fssize 253403070464 fsndevs 1

type 10007  "resize"
time 1247176021 840885
kernel VxFS 5.0_REV-s_5_0x86A12_sol SunOS 5.10
oblks 247463936  nblks 247463935
devid 0
 

Gaurav_S
Moderator
Moderator
   VIP    Certified

you can decode that time via

# echo "0t1131980899=Y" | adb

 

Gaurav