* ADVFS fileset information
@ 2002-01-31 14:42 Narasimha
2002-02-01 9:39 ` Marre des Spameurs qui prennent les add dans les news [SauroN]
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Narasimha @ 2002-01-31 14:42 UTC (permalink / raw)
Hi,
I am working on the ADVFS filesystem and was interested to know if
there is any way to get the fileset information in terms of the
extents/disks that the fileset spans over. Also there is a shared
library of advfs system calls libmsfs.so which has a lot of advfs
related calls. Any leads on where to find documentation or prototypes
for these calls would be great. Thanks in advance.
Narasimha.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ADVFS fileset information
2002-01-31 14:42 ADVFS fileset information Narasimha
@ 2002-02-01 9:39 ` Marre des Spameurs qui prennent les add dans les news [SauroN]
2002-02-01 14:28 ` Narasimha
2002-02-01 15:15 ` Bob Harris
2 siblings, 0 replies; 13+ messages in thread
From: Marre des Spameurs qui prennent les add dans les news [SauroN] @ 2002-02-01 9:39 UTC (permalink / raw)
you can go inside the .tags directory and do showfile -x M-6
you can t see this file if you do ls -l but if u you can watch it with ls -l
M-6 (or M-12 )
inside .tags you heve many file ans directory like M-1 M-2 1 2 .......
for the extend meta data status showfile -x M-6
"Narasimha" <mknarasimha@hotmail.com> wrote in message
news:b9019227.0201310642.c30cf91@posting.google.com...
| Hi,
|
| I am working on the ADVFS filesystem and was interested to know if
| there is any way to get the fileset information in terms of the
| extents/disks that the fileset spans over. Also there is a shared
| library of advfs system calls libmsfs.so which has a lot of advfs
| related calls. Any leads on where to find documentation or prototypes
| for these calls would be great. Thanks in advance.
|
| Narasimha.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ADVFS fileset information
2002-01-31 14:42 ADVFS fileset information Narasimha
2002-02-01 9:39 ` Marre des Spameurs qui prennent les add dans les news [SauroN]
@ 2002-02-01 14:28 ` Narasimha
2002-02-04 15:40 ` Bob Harris
2002-02-01 15:15 ` Bob Harris
2 siblings, 1 reply; 13+ messages in thread
From: Narasimha @ 2002-02-01 14:28 UTC (permalink / raw)
Hi,
This is regarding the showfile -x M-6 of the M-6 file in the .tags directory:
Does the file M-6 alone consist of the extent information for the fileset or do
other files also consist of extent Information about the fileset?
Thanks,
Narasimha.
mknarasimha@hotmail.com (Narasimha) wrote in message news:<b9019227.0201310642.c30cf91@posting.google.com>...
> Hi,
>
> I am working on the ADVFS filesystem and was interested to know if
> there is any way to get the fileset information in terms of the
> extents/disks that the fileset spans over. Also there is a shared
> library of advfs system calls libmsfs.so which has a lot of advfs
> related calls. Any leads on where to find documentation or prototypes
> for these calls would be great. Thanks in advance.
>
> Narasimha.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ADVFS fileset information
2002-01-31 14:42 ADVFS fileset information Narasimha
2002-02-01 9:39 ` Marre des Spameurs qui prennent les add dans les news [SauroN]
2002-02-01 14:28 ` Narasimha
@ 2002-02-01 15:15 ` Bob Harris
2002-02-04 16:47 ` Narasimha
2 siblings, 1 reply; 13+ messages in thread
From: Bob Harris @ 2002-02-01 15:15 UTC (permalink / raw)
In article <b9019227.0201310642.c30cf91@posting.google.com>, Narasimha
<mknarasimha@hotmail.com> wrote:
X Hi,
X
X I am working on the ADVFS filesystem and was interested to know if
X there is any way to get the fileset information in terms of the
X extents/disks that the fileset spans over. ......................
Nothing that is easy. A fileset is really nothing more than a name
space. You might as well just walk the director tree and use a
showfile -x on each file in the fileset. There are no system calls
(neither public nor private) that output that information.
You could play with nvbmtpg (see the man page), but parsing the output
of that would be just about as much work as parsing showfile -x option
for each file, plus nvbmtpg analysis would require more reverse
engineering on your part.
X .......................................... Also there is a shared
X library of advfs system calls libmsfs.so which has a lot of advfs
X related calls. Any leads on where to find documentation or prototypes
X for these calls would be great. Thanks in advance.
The only ones that I know of which are documented are the ones
mentioned in the "man 4 advfs" man page, and these are APIs to aid
backup utilities.
Plus there is fcntl(fd,F_GETMAP,arg) to fetch a file's extent map (used
to properly restore sparse holes in backed up files). I supposed you
could use F_GETMAP instead of showfile to collect extent information on
a fileset.
Bob Harris
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ADVFS fileset information
2002-02-01 14:28 ` Narasimha
@ 2002-02-04 15:40 ` Bob Harris
0 siblings, 0 replies; 13+ messages in thread
From: Bob Harris @ 2002-02-04 15:40 UTC (permalink / raw)
In article <b9019227.0202010628.7f06a60a@posting.google.com>, Narasimha
<mknarasimha@hotmail.com> wrote:
X Hi,
X
X This is regarding the showfile -x M-6 of the M-6 file in the .tags directory:
X Does the file M-6 alone consist of the extent information for the fileset or
X do other files also consist of extent Information about the fileset?
X
X Thanks,
X Narasimha.
.tags/M-6 is the Bitfile Metadata Table (BMT) of the first volume of
the domain. ./tags/M-12 is the BMT for the 2nd volume, ./tags/M-18 is
the BMT for the 3rd volume, etc...
The BMT is domain wide and provides metadata storage for _ALL_ filesets
in a domain. It is not specificily associated with any individual
fileset.
A fileset is a name space. Its primary component is a tag directory
that contains translations between the bitfile tag ID (like an inode
number) and the file's primary mcell (mcells are stored in the BMT and
a file may use multiple mcells depending on its metadata storage
needs). There is a tag directory for each fileset in a domain. The
root tag directory keeps track of each fileset's tag directory.
As to file extent information, yes, that is stored in the BMT's along
with all the other file attribute and metadata information. A file may
have mcells in multiple which are chained together and may be located
on multiple BMT's. For example, if a file has storage on 2 volumes of
a domain, then the BMT of each of those volumes will contain mcells for
that file to describe that storage.
Bob Harris
X mknarasimha@hotmail.com (Narasimha) wrote in message
X news:<b9019227.0201310642.c30cf91@posting.google.com>...
X > Hi,
X >
X > I am working on the ADVFS filesystem and was interested to know if
X > there is any way to get the fileset information in terms of the
X > extents/disks that the fileset spans over. Also there is a shared
X > library of advfs system calls libmsfs.so which has a lot of advfs
X > related calls. Any leads on where to find documentation or prototypes
X > for these calls would be great. Thanks in advance.
X >
X > Narasimha.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ADVFS fileset information
2002-02-01 15:15 ` Bob Harris
@ 2002-02-04 16:47 ` Narasimha
2002-02-05 15:18 ` Bob Harris
0 siblings, 1 reply; 13+ messages in thread
From: Narasimha @ 2002-02-04 16:47 UTC (permalink / raw)
Hi Bob,
Thanks for the information. Regarding the showfile on each file of the
fileset: Can we determine the starting and ending offset on a device
for the fileset by doing a fileshow on the files in the fileset? My
intent is to get the starting offset of the fileset extents and the
size of the extents. Can this be accomplished by the fcntl call(with
F_GETMAP). The problem is that the fcntl call will not account for the
advfs fileset as a whole and just work for the UFS directory which is
the mountpoint. It would be great if you could clarify on the showfile
and vbmtpg.
Thanks,
Narasimha.
Bob Harris <harris@zk3.dec.com> wrote in message news:<010220021015379536%harris@zk3.dec.com>...
> In article <b9019227.0201310642.c30cf91@posting.google.com>, Narasimha
> <mknarasimha@hotmail.com> wrote:
>
> X Hi,
> X
> X I am working on the ADVFS filesystem and was interested to know if
> X there is any way to get the fileset information in terms of the
> X extents/disks that the fileset spans over. ......................
>
> Nothing that is easy. A fileset is really nothing more than a name
> space. You might as well just walk the director tree and use a
> showfile -x on each file in the fileset. There are no system calls
> (neither public nor private) that output that information.
>
> You could play with nvbmtpg (see the man page), but parsing the output
> of that would be just about as much work as parsing showfile -x option
> for each file, plus nvbmtpg analysis would require more reverse
> engineering on your part.
>
> X .......................................... Also there is a shared
> X library of advfs system calls libmsfs.so which has a lot of advfs
> X related calls. Any leads on where to find documentation or prototypes
> X for these calls would be great. Thanks in advance.
>
> The only ones that I know of which are documented are the ones
> mentioned in the "man 4 advfs" man page, and these are APIs to aid
> backup utilities.
>
> Plus there is fcntl(fd,F_GETMAP,arg) to fetch a file's extent map (used
> to properly restore sparse holes in backed up files). I supposed you
> could use F_GETMAP instead of showfile to collect extent information on
> a fileset.
>
> Bob Harris
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ADVFS fileset information
2002-02-04 16:47 ` Narasimha
@ 2002-02-05 15:18 ` Bob Harris
2002-02-05 21:12 ` Narasimha
0 siblings, 1 reply; 13+ messages in thread
From: Bob Harris @ 2002-02-05 15:18 UTC (permalink / raw)
In article <b9019227.0202040847.2765525c@posting.google.com>, Narasimha
<mknarasimha@hotmail.com> wrote:
X Hi Bob,
X
X Thanks for the information. Regarding the showfile on each file of the
X fileset: Can we determine the starting and ending offset on a device
X for the fileset by doing a fileshow on the files in the fileset? My
X intent is to get the starting offset of the fileset extents and the
X size of the extents. ...............................................
A fileset does not have a location. A fileset is just the name space
that you see via directory trees. The only storage directly related to
the fileset is the very small tag directory that translates bitfile tag
ID (like an inode) to the primary mcell location for each file.
Files are what have location on the different volumes of a domain. The
location for a file can be moved behind the file's back using the
defragment, balance, migrate, or rmvol commands.
File are associated with a fileset since the file has a name and that
name is kept in a fileset's name space.
If you are trying to build a map of where each file's storage is
located on each volume of a domain, then you can use showfile -x to get
extent information on each file. The 'vol' column tells you which
volume of a multi-volume domain the extent is located on. The
'volBlock' column tells you the first 512 byte sector location of the
extent. the 'blockCnt' tells you how many contiguous 512 byte sectors
are in the extent.
If you get this information for every file in a fileset's name space,
then you will be able to build a map of what 512 byte sectors on the
disk contain file data.
If you have multiple filesets, then the files in each fileset's name
space will be intermixed in the domain. There is not attempt to order
or place files from one fileset differently than another fileset's
files. Files get storage allocated to them from the domain on a first
come first served basis.
X ................................................................ My
X intent is to get the starting offset of the fileset extents and the
X size of the extents. Can this be accomplished by the fcntl call(with
X F_GETMAP). ...........................................................
No, I do not think so. fcntl(F_GETMAP) does not tell you the physical
location of a file's extents on the disk. It just tells you what parts
of the file have storage allocated and what parts are sparse holes. So
you would need to use something like showfile -x to get physical
locations of extents on the disk for each file.
X .......... The problem is that the fcntl call will not account for the
X advfs fileset as a whole and just work for the UFS directory which is
X the mountpoint. ......................................................
_NOTHING_ shows all the storage associated with a fileset as a whole.
fcntl(F_GETMAP) is a per file utility. If you point it at the mount
point, then it tells you about the root directory of that mounted file
systems. If you want fcntl(F_GETMAP) information for every file in a
file system, then you need to call fcntl(F_GETMAP) once for every file
in the file system.
But again, fcntl(F_GETMAP) does not tell you where extents are located
on the physical disk, it just tells you about what parts of a file have
storage and what parts have sparse holes.
X ............... It would be great if you could clarify on the showfile
X and vbmtpg.
Showfile -x is rather straight forward. It shows you the allocated
storatge of a file, offset of the extent as an 8K page inside of the
file (offsets that are not covered by an extent are sparse holes), and
it shows where the extent lives in the physical domain. Not much more
to tell.
As for the old out dated vbmtpg, it was replaced by nvbmtpg in newer
versions of Tru64 UNIX and both of them along with the other tools in
/sbin/advfs/* are non-trivial tools for analyzing the AdvFS on-disk
structures. What public information is available on them is in the man
pages. After that, it is a matter of either reverse engineering what
you see, or getting a source license and studying the sources.
But if you are still looking for a magic tool that will tell you what
subset of storage is being used by all the files described by a single
fileset's name space, then you are not going to find it (it is not the
kind of information that is interesting to most people, especially
AdvFS developers), so you will need to write you own tool.
Here is a rude, crude, and slow script (which is _NOT_ very well
debugged and will most likely break) that will find the high and low
blocks used by a given fileset:
#!/bin/ksh
#
if [[ $# = 0 ]]; then
echo 1>&2 "Usage: fileset_lo_hi_allocation.ksh mount_point"
exit 1
fi
find $1 -mount -exec showfile -x {} \; | awk '
$1 == pageOff { next }
NF == 5 {
if ( vol < $3 )
vol = $3
if ( lo[$3] > $4 || lo[$3] == 0 )
lo[$3] = $4
n = $4 + $5 - 1
if ( hi[$3] < n )
hi[$3] = n
}
END {
for(j=1; j <= vol; j++ ) {
if ( j in lo ) {
printf("vol:%d lo:%d hi:%d\n",
j, lo[j], hi[j])
}
}
}' # don't miss the closing single quote or not work.
This is _NOT_ what you asked for, but it does show using the showfile
-x command in a script. You can copy the algorithm into another
language and use different tools and you can expand on the algorithm to
do what you want.
I'm just not sure what you want makes any sense (at least not with
respect to an AdvFS domain). Do you have an overall goal in mind. A
"Big Picture" if you will.
Bob Harris
X Thanks,
X Narasimha.
X Bob Harris <harris@zk3.dec.com> wrote in message
X news:<010220021015379536%harris@zk3.dec.com>...
X > In article <b9019227.0201310642.c30cf91@posting.google.com>, Narasimha
X > <mknarasimha@hotmail.com> wrote:
X >
X > X Hi,
X > X
X > X I am working on the ADVFS filesystem and was interested to know if
X > X there is any way to get the fileset information in terms of the
X > X extents/disks that the fileset spans over. ......................
X >
X > Nothing that is easy. A fileset is really nothing more than a name
X > space. You might as well just walk the director tree and use a
X > showfile -x on each file in the fileset. There are no system calls
X > (neither public nor private) that output that information.
X >
X > You could play with nvbmtpg (see the man page), but parsing the output
X > of that would be just about as much work as parsing showfile -x option
X > for each file, plus nvbmtpg analysis would require more reverse
X > engineering on your part.
X >
X > X .......................................... Also there is a shared
X > X library of advfs system calls libmsfs.so which has a lot of advfs
X > X related calls. Any leads on where to find documentation or prototypes
X > X for these calls would be great. Thanks in advance.
X >
X > The only ones that I know of which are documented are the ones
X > mentioned in the "man 4 advfs" man page, and these are APIs to aid
X > backup utilities.
X >
X > Plus there is fcntl(fd,F_GETMAP,arg) to fetch a file's extent map (used
X > to properly restore sparse holes in backed up files). I supposed you
X > could use F_GETMAP instead of showfile to collect extent information on
X > a fileset.
X >
X > Bob Harris
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ADVFS fileset information
2002-02-05 15:18 ` Bob Harris
@ 2002-02-05 21:12 ` Narasimha
2002-02-06 15:18 ` Bob Harris
0 siblings, 1 reply; 13+ messages in thread
From: Narasimha @ 2002-02-05 21:12 UTC (permalink / raw)
Hi Bob,
Thanks for the info. The method that you suggest involves getting the
list
of files contained in the fileset directory and then do a showfile -x
on each of them to get their extent map. Would it be possible to
construct a lower and upper bound for the extent offsets on a
particular volume(i.e can one say that a fileset spans from offset x
to offset y on a volume in the domain?). Also i was doing a bit of
study on the clonefset utility which makes a clone of the fileset:
This seems to invoke a msfs_syscall systemcall and doesnt seem to
traverse the whole directory tree which brings me back to the premise
that there must be a system call which gets the information on a
fileset. It would be great if you could let me know.
Thanks,
Narasimha.
Bob Harris <harris@zk3.dec.com> wrote in message news:<050220021018184859%harris@zk3.dec.com>...
> In article <b9019227.0202040847.2765525c@posting.google.com>, Narasimha
> <mknarasimha@hotmail.com> wrote:
>
> X Hi Bob,
> X
> X Thanks for the information. Regarding the showfile on each file of the
> X fileset: Can we determine the starting and ending offset on a device
> X for the fileset by doing a fileshow on the files in the fileset? My
> X intent is to get the starting offset of the fileset extents and the
> X size of the extents. ...............................................
>
> A fileset does not have a location. A fileset is just the name space
> that you see via directory trees. The only storage directly related to
> the fileset is the very small tag directory that translates bitfile tag
> ID (like an inode) to the primary mcell location for each file.
>
> Files are what have location on the different volumes of a domain. The
> location for a file can be moved behind the file's back using the
> defragment, balance, migrate, or rmvol commands.
>
> File are associated with a fileset since the file has a name and that
> name is kept in a fileset's name space.
>
> If you are trying to build a map of where each file's storage is
> located on each volume of a domain, then you can use showfile -x to get
> extent information on each file. The 'vol' column tells you which
> volume of a multi-volume domain the extent is located on. The
> 'volBlock' column tells you the first 512 byte sector location of the
> extent. the 'blockCnt' tells you how many contiguous 512 byte sectors
> are in the extent.
>
> If you get this information for every file in a fileset's name space,
> then you will be able to build a map of what 512 byte sectors on the
> disk contain file data.
>
> If you have multiple filesets, then the files in each fileset's name
> space will be intermixed in the domain. There is not attempt to order
> or place files from one fileset differently than another fileset's
> files. Files get storage allocated to them from the domain on a first
> come first served basis.
>
> X ................................................................ My
> X intent is to get the starting offset of the fileset extents and the
> X size of the extents. Can this be accomplished by the fcntl call(with
> X F_GETMAP). ...........................................................
>
> No, I do not think so. fcntl(F_GETMAP) does not tell you the physical
> location of a file's extents on the disk. It just tells you what parts
> of the file have storage allocated and what parts are sparse holes. So
> you would need to use something like showfile -x to get physical
> locations of extents on the disk for each file.
>
> X .......... The problem is that the fcntl call will not account for the
> X advfs fileset as a whole and just work for the UFS directory which is
> X the mountpoint. ......................................................
>
> _NOTHING_ shows all the storage associated with a fileset as a whole.
> fcntl(F_GETMAP) is a per file utility. If you point it at the mount
> point, then it tells you about the root directory of that mounted file
> systems. If you want fcntl(F_GETMAP) information for every file in a
> file system, then you need to call fcntl(F_GETMAP) once for every file
> in the file system.
>
> But again, fcntl(F_GETMAP) does not tell you where extents are located
> on the physical disk, it just tells you about what parts of a file have
> storage and what parts have sparse holes.
>
> X ............... It would be great if you could clarify on the showfile
> X and vbmtpg.
>
> Showfile -x is rather straight forward. It shows you the allocated
> storatge of a file, offset of the extent as an 8K page inside of the
> file (offsets that are not covered by an extent are sparse holes), and
> it shows where the extent lives in the physical domain. Not much more
> to tell.
>
> As for the old out dated vbmtpg, it was replaced by nvbmtpg in newer
> versions of Tru64 UNIX and both of them along with the other tools in
> /sbin/advfs/* are non-trivial tools for analyzing the AdvFS on-disk
> structures. What public information is available on them is in the man
> pages. After that, it is a matter of either reverse engineering what
> you see, or getting a source license and studying the sources.
>
> But if you are still looking for a magic tool that will tell you what
> subset of storage is being used by all the files described by a single
> fileset's name space, then you are not going to find it (it is not the
> kind of information that is interesting to most people, especially
> AdvFS developers), so you will need to write you own tool.
>
> Here is a rude, crude, and slow script (which is _NOT_ very well
> debugged and will most likely break) that will find the high and low
> blocks used by a given fileset:
>
> #!/bin/ksh
> #
> if [[ $# = 0 ]]; then
> echo 1>&2 "Usage: fileset_lo_hi_allocation.ksh mount_point"
> exit 1
> fi
>
> find $1 -mount -exec showfile -x {} \; | awk '
> $1 == pageOff { next }
> NF == 5 {
> if ( vol < $3 )
> vol = $3
> if ( lo[$3] > $4 || lo[$3] == 0 )
> lo[$3] = $4
> n = $4 + $5 - 1
> if ( hi[$3] < n )
> hi[$3] = n
> }
> END {
> for(j=1; j <= vol; j++ ) {
> if ( j in lo ) {
> printf("vol:%d lo:%d hi:%d\n",
> j, lo[j], hi[j])
> }
> }
> }' # don't miss the closing single quote or not work.
>
> This is _NOT_ what you asked for, but it does show using the showfile
> -x command in a script. You can copy the algorithm into another
> language and use different tools and you can expand on the algorithm to
> do what you want.
>
> I'm just not sure what you want makes any sense (at least not with
> respect to an AdvFS domain). Do you have an overall goal in mind. A
> "Big Picture" if you will.
>
> Bob Harris
>
> X Thanks,
> X Narasimha.
>
> X Bob Harris <harris@zk3.dec.com> wrote in message
> X news:<010220021015379536%harris@zk3.dec.com>...
> X > In article <b9019227.0201310642.c30cf91@posting.google.com>, Narasimha
> X > <mknarasimha@hotmail.com> wrote:
> X >
> X > X Hi,
> X > X
> X > X I am working on the ADVFS filesystem and was interested to know if
> X > X there is any way to get the fileset information in terms of the
> X > X extents/disks that the fileset spans over. ......................
> X >
> X > Nothing that is easy. A fileset is really nothing more than a name
> X > space. You might as well just walk the director tree and use a
> X > showfile -x on each file in the fileset. There are no system calls
> X > (neither public nor private) that output that information.
> X >
> X > You could play with nvbmtpg (see the man page), but parsing the output
> X > of that would be just about as much work as parsing showfile -x option
> X > for each file, plus nvbmtpg analysis would require more reverse
> X > engineering on your part.
> X >
> X > X .......................................... Also there is a shared
> X > X library of advfs system calls libmsfs.so which has a lot of advfs
> X > X related calls. Any leads on where to find documentation or prototypes
> X > X for these calls would be great. Thanks in advance.
> X >
> X > The only ones that I know of which are documented are the ones
> X > mentioned in the "man 4 advfs" man page, and these are APIs to aid
> X > backup utilities.
> X >
> X > Plus there is fcntl(fd,F_GETMAP,arg) to fetch a file's extent map (used
> X > to properly restore sparse holes in backed up files). I supposed you
> X > could use F_GETMAP instead of showfile to collect extent information on
> X > a fileset.
> X >
> X > Bob Harris
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ADVFS fileset information
2002-02-05 21:12 ` Narasimha
@ 2002-02-06 15:18 ` Bob Harris
2002-02-06 22:48 ` Narasimha
0 siblings, 1 reply; 13+ messages in thread
From: Bob Harris @ 2002-02-06 15:18 UTC (permalink / raw)
In article <b9019227.0202051312.33fc9979@posting.google.com>, Narasimha
<mknarasimha@hotmail.com> wrote:
X Hi Bob,
X
X Thanks for the info. The method that you suggest involves getting the
X list of files contained in the fileset directory and then do a
X showfile -x on each of them to get their extent map. .............
That is what I've said in every reply I've posted, so at least I'm
consistant.
X ........................................ Would it be possible to
X construct a lower and upper bound for the extent offsets on a
X particular volume(i.e can one say that a fileset spans from offset x
X to offset y on a volume in the domain?). .........................
If you look at all the extents of all the files in the fileset name
space, you can find the file that owns the lowest numbered block on a
given volume and the file that owns the highest numbered block.
Filesets do not have storage which is why nothing in AdvFS tracks that
information. Individual files have storage, and from a domain
perspective, all files are the same, and get stored anywhere storage is
available at the time they are created without regard for what fileset
they belong to.
And I get back to a previous question. What is your goal in finding
the lowest numbered block of an extent owned by a file which happens to
be listed in a specific fileset's name space, and finding the highest
numbered block of an extent owned by a file which also happens to be
named in the same fileset's name space?
What is the big picture question you are trying to answer?
X ........................................ Also i was doing a bit of
X study on the clonefset utility which makes a clone of the fileset:
X This seems to invoke a msfs_syscall systemcall and doesnt seem to
X traverse the whole directory tree which brings me back to the premise
X that there must be a system call which gets the information on a
X fileset. ...........................................
No, sorry a clone does not work the way you seem to be thinking. A
clone starts by marking the original fileset so that it knows it has
been cloned, then it duplicates the original fileset's tag directory
(I've mentioned this before; it provides tranlations between bitfile
tag ID's (like an inode) to the primary mcell location for each file in
the fileset name space.
From this point forward, if there is a change to any file, the clone
fileset allocates a new primary mcell for the file (on the first
modification of a file), and puts that the clone file's primary mcell
the clone's tag directory file. Then just enough new storage is
allocated for the clone to equal the amount of storage being modified,
and the original data being modified is copied to the new storage in
the clone (copy-on-write or COW), then the original file's storage is
modified. An original file being deleted or truncated, just has all of
its original storage moved directly into the clone (after all it
doesn't need it any more).
An empty clone fileset just contains a tag directory and some state
information on the original fileset to say there is a clone.
There is no need for the clone to know anything more about the files in
the original fileset, nor about what storage those files use until the
original files start to be modified.
When the clone is mounted and then read (such as during a backup),
since it has a copy of the original's tag directory, it can find all
the unmodified data of the files in the original fileset name space.
And for modified files, the clone has its own tracking primary mcell
that keeps track of the storage that was modified in the original,
otherwise, the clone uses the original file's mcell information to read
the unmodified storage of the modified file.
Removing a clone consists of walking the clone's tag directory file and
deleting all the storage and mcells that were allocated to the clone
because of modifications to the original fileset. A clone that
experienced very few copy-on-write operations will have very little to
delete and will be rmfset'ed very quickly. A clone that has had lots
of copy-on-write operations performed to it, will take much longer to
rmfset.
Now I've been saying that a fileset is just a name space. If you think
about the fact that a clone fileset starts out life as just a name
space that points to the same files as it original, and from a read
perspective, the file does not care whether it is read by the original
fileset or by the cloned fileset. So a name space is like your address
book. It is just a pointer to the real thing, and the real think for a
file is its metadata and storage kept in the domain, _NOT_ in the
fileset which is just an address book that points to the file. And a
cloned fileset is just a copy of the original address book.
Once modifications start to happen, the 2 address books get marked up
and start to diverge, but the fact still remains that a fileset just
keeps track of the names (actually the bitfile tag numbers) of files it
is tracking and where they are located. Nothing more.
X fileset. It would be great if you could let me know.
What you are looking for does not exist. There is no need for it to
exist. It has no value to AdvFS, so there is no need to track that
information and no need to build an interface to get it.
----
By the way, I said my example script was not very well debugged, and I
was correct. The string pageOff should have been enclosed in double
quotes as "pageOff". I've corrected the example below:
X> Here is a rude, crude, and slow script (which is _NOT_ very well
X> debugged and will most likely break) that will find the high and low
X> blocks used by a given fileset:
X>
X> #!/bin/ksh
X> #
X> if [[ $# = 0 ]]; then
X> echo 1>&2 "Usage: fileset_lo_hi_allocation.ksh mount_point"
X> exit 1
X> fi
X>
X> find $1 -mount -exec showfile -x {} \; | awk '
X> $1 == "pageOff" { next }
X> NF == 5 {
X> if ( vol < $3 )
X> vol = $3
X> if ( lo[$3] > $4 || lo[$3] == 0 )
X> lo[$3] = $4
X> n = $4 + $5 - 1
X> if ( hi[$3] < n )
X> hi[$3] = n
X> }
X> END {
X> for(j=1; j <= vol; j++ ) {
X> if ( j in lo ) {
X> printf("vol:%d lo:%d hi:%d\n",
X> j, lo[j], hi[j])
X> }
X> }
X> }' # don't miss the closing single quote or not work.
Bob Harris
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ADVFS fileset information
2002-02-06 15:18 ` Bob Harris
@ 2002-02-06 22:48 ` Narasimha
2002-02-07 3:21 ` Bob Harris
0 siblings, 1 reply; 13+ messages in thread
From: Narasimha @ 2002-02-06 22:48 UTC (permalink / raw)
Hi Bob,
Thanks for the info. I get it. The other question regarding your
script is that it doesnt try to access the bitmap metadata files and
calculate their extents as well. Arent these files part of the fileset
and shouldnt we be taking the extent information of those files as
well? (i am talking about the M-6 and M-12 files).
thanks,
Narasimha.
Bob Harris <harris@zk3.dec.com> wrote in message news:<060220021018087142%harris@zk3.dec.com>...
> In article <b9019227.0202051312.33fc9979@posting.google.com>, Narasimha
> <mknarasimha@hotmail.com> wrote:
>
> X Hi Bob,
> X
> X Thanks for the info. The method that you suggest involves getting the
> X list of files contained in the fileset directory and then do a
> X showfile -x on each of them to get their extent map. .............
>
> That is what I've said in every reply I've posted, so at least I'm
> consistant.
>
> X ........................................ Would it be possible to
> X construct a lower and upper bound for the extent offsets on a
> X particular volume(i.e can one say that a fileset spans from offset x
> X to offset y on a volume in the domain?). .........................
>
> If you look at all the extents of all the files in the fileset name
> space, you can find the file that owns the lowest numbered block on a
> given volume and the file that owns the highest numbered block.
>
> Filesets do not have storage which is why nothing in AdvFS tracks that
> information. Individual files have storage, and from a domain
> perspective, all files are the same, and get stored anywhere storage is
> available at the time they are created without regard for what fileset
> they belong to.
>
> And I get back to a previous question. What is your goal in finding
> the lowest numbered block of an extent owned by a file which happens to
> be listed in a specific fileset's name space, and finding the highest
> numbered block of an extent owned by a file which also happens to be
> named in the same fileset's name space?
>
> What is the big picture question you are trying to answer?
>
> X ........................................ Also i was doing a bit of
> X study on the clonefset utility which makes a clone of the fileset:
> X This seems to invoke a msfs_syscall systemcall and doesnt seem to
> X traverse the whole directory tree which brings me back to the premise
> X that there must be a system call which gets the information on a
> X fileset. ...........................................
>
> No, sorry a clone does not work the way you seem to be thinking. A
> clone starts by marking the original fileset so that it knows it has
> been cloned, then it duplicates the original fileset's tag directory
> (I've mentioned this before; it provides tranlations between bitfile
> tag ID's (like an inode) to the primary mcell location for each file in
> the fileset name space.
>
> From this point forward, if there is a change to any file, the clone
> fileset allocates a new primary mcell for the file (on the first
> modification of a file), and puts that the clone file's primary mcell
> the clone's tag directory file. Then just enough new storage is
> allocated for the clone to equal the amount of storage being modified,
> and the original data being modified is copied to the new storage in
> the clone (copy-on-write or COW), then the original file's storage is
> modified. An original file being deleted or truncated, just has all of
> its original storage moved directly into the clone (after all it
> doesn't need it any more).
>
> An empty clone fileset just contains a tag directory and some state
> information on the original fileset to say there is a clone.
>
> There is no need for the clone to know anything more about the files in
> the original fileset, nor about what storage those files use until the
> original files start to be modified.
>
> When the clone is mounted and then read (such as during a backup),
> since it has a copy of the original's tag directory, it can find all
> the unmodified data of the files in the original fileset name space.
> And for modified files, the clone has its own tracking primary mcell
> that keeps track of the storage that was modified in the original,
> otherwise, the clone uses the original file's mcell information to read
> the unmodified storage of the modified file.
>
> Removing a clone consists of walking the clone's tag directory file and
> deleting all the storage and mcells that were allocated to the clone
> because of modifications to the original fileset. A clone that
> experienced very few copy-on-write operations will have very little to
> delete and will be rmfset'ed very quickly. A clone that has had lots
> of copy-on-write operations performed to it, will take much longer to
> rmfset.
>
> Now I've been saying that a fileset is just a name space. If you think
> about the fact that a clone fileset starts out life as just a name
> space that points to the same files as it original, and from a read
> perspective, the file does not care whether it is read by the original
> fileset or by the cloned fileset. So a name space is like your address
> book. It is just a pointer to the real thing, and the real think for a
> file is its metadata and storage kept in the domain, _NOT_ in the
> fileset which is just an address book that points to the file. And a
> cloned fileset is just a copy of the original address book.
>
> Once modifications start to happen, the 2 address books get marked up
> and start to diverge, but the fact still remains that a fileset just
> keeps track of the names (actually the bitfile tag numbers) of files it
> is tracking and where they are located. Nothing more.
>
> X fileset. It would be great if you could let me know.
>
> What you are looking for does not exist. There is no need for it to
> exist. It has no value to AdvFS, so there is no need to track that
> information and no need to build an interface to get it.
>
> ----
>
> By the way, I said my example script was not very well debugged, and I
> was correct. The string pageOff should have been enclosed in double
> quotes as "pageOff". I've corrected the example below:
>
> X> Here is a rude, crude, and slow script (which is _NOT_ very well
> X> debugged and will most likely break) that will find the high and low
> X> blocks used by a given fileset:
> X>
> X> #!/bin/ksh
> X> #
> X> if [[ $# = 0 ]]; then
> X> echo 1>&2 "Usage: fileset_lo_hi_allocation.ksh mount_point"
> X> exit 1
> X> fi
> X>
> X> find $1 -mount -exec showfile -x {} \; | awk '
> X> $1 == "pageOff" { next }
> X> NF == 5 {
> X> if ( vol < $3 )
> X> vol = $3
> X> if ( lo[$3] > $4 || lo[$3] == 0 )
> X> lo[$3] = $4
> X> n = $4 + $5 - 1
> X> if ( hi[$3] < n )
> X> hi[$3] = n
> X> }
> X> END {
> X> for(j=1; j <= vol; j++ ) {
> X> if ( j in lo ) {
> X> printf("vol:%d lo:%d hi:%d\n",
> X> j, lo[j], hi[j])
> X> }
> X> }
> X> }' # don't miss the closing single quote or not work.
>
>
> Bob Harris
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ADVFS fileset information
2002-02-06 22:48 ` Narasimha
@ 2002-02-07 3:21 ` Bob Harris
2002-02-07 13:37 ` Narasimha
0 siblings, 1 reply; 13+ messages in thread
From: Bob Harris @ 2002-02-07 3:21 UTC (permalink / raw)
In article <b9019227.0202061448.42e7f196@posting.google.com>, Narasimha
<mknarasimha@hotmail.com> wrote:
X Thanks for the info. I get it. The other question regarding your
X script is that it doesnt try to access the bitmap metadata files and
X calculate their extents as well. Arent these files part of the fileset
X and shouldnt we be taking the extent information of those files as
X well? (i am talking about the M-6 and M-12 files).
I said my script was rude, crude, and not very well debugged. All that
it did was to find the lowest and highest allocated block used by file
data. The script was nothing more. At the time that seems to be what
you were interested in.
Since you have not told us what your goal is, there is no way I would
attempt to write a script to solve it. So what is your goal? What is
it you are trying to do?
And back to the fileset. Again, the fileset is just a name space and
consists of a tag directory that keeps track of bitfile tag IDs (like
an inode number) and points at the primary mcell of each file known to
the fileset. The file itself may be part of the original fileset and
it may be part of the clone fileset, so the file itself is not
dedicated to a fileset, but rather an entity pointed to by a fileset.
All the other metadata is part of the domain and is shared by _ALL_
filesets in the domain.
The utility /sbin/advfs/vdf can be used to display the amount of space
being used by metadata. There should be a man page for vdf.
Bob Harris
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ADVFS fileset information
2002-02-07 3:21 ` Bob Harris
@ 2002-02-07 13:37 ` Narasimha
2002-02-08 17:36 ` Bob Harris
0 siblings, 1 reply; 13+ messages in thread
From: Narasimha @ 2002-02-07 13:37 UTC (permalink / raw)
Hi Bob,
I thought i had cleared out our goal. Our goal is to find the extents
that a
fileset occupies on disk.People can write scripts read the extent
information(offset and size and perform backups) Currently there is no
way to do this other than walking thro all the files of the fileset
and then finding all the extents occupied by all the files and then
collapse them wherever possible and give the output(this effort is
time consuming). Our goal was to find the extents that a fileset maps
to but since you mentioned that the fileset is just a name in a name
space we probably need to stick to the method you mentioned.
Continuing on the previous conversation: If we indeed walk thro all
the files in the fileset and get the file extents we would need to
find the extents of the special files M-6 and M-12 as well but these
files are somehow hidden but i am pretty sure that they occupy space
on the fileset and we need to account for their extent information as
well. My question was concerns about opening these files and doing a
showfile on them? Hope i have clarified things.
Thanks,
narasimha.
Bob Harris <harris@zk3.dec.com> wrote in message news:<060220022221358166%harris@zk3.dec.com>...
> In article <b9019227.0202061448.42e7f196@posting.google.com>, Narasimha
> <mknarasimha@hotmail.com> wrote:
>
> X Thanks for the info. I get it. The other question regarding your
> X script is that it doesnt try to access the bitmap metadata files and
> X calculate their extents as well. Arent these files part of the fileset
> X and shouldnt we be taking the extent information of those files as
> X well? (i am talking about the M-6 and M-12 files).
>
> I said my script was rude, crude, and not very well debugged. All that
> it did was to find the lowest and highest allocated block used by file
> data. The script was nothing more. At the time that seems to be what
> you were interested in.
>
> Since you have not told us what your goal is, there is no way I would
> attempt to write a script to solve it. So what is your goal? What is
> it you are trying to do?
>
> And back to the fileset. Again, the fileset is just a name space and
> consists of a tag directory that keeps track of bitfile tag IDs (like
> an inode number) and points at the primary mcell of each file known to
> the fileset. The file itself may be part of the original fileset and
> it may be part of the clone fileset, so the file itself is not
> dedicated to a fileset, but rather an entity pointed to by a fileset.
>
> All the other metadata is part of the domain and is shared by _ALL_
> filesets in the domain.
>
> The utility /sbin/advfs/vdf can be used to display the amount of space
> being used by metadata. There should be a man page for vdf.
>
> Bob Harris
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ADVFS fileset information
2002-02-07 13:37 ` Narasimha
@ 2002-02-08 17:36 ` Bob Harris
0 siblings, 0 replies; 13+ messages in thread
From: Bob Harris @ 2002-02-08 17:36 UTC (permalink / raw)
In article <b9019227.0202070537.34625e79@posting.google.com>, Narasimha
<mknarasimha@hotmail.com> wrote:
X Hi Bob,
X
X I thought i had cleared out our goal. Our goal is to find the extents
X that a
X fileset occupies on disk.People can write scripts read the extent
X information(offset and size and perform backups) Currently there is no
X way to do this other than walking thro all the files of the fileset
X and then finding all the extents occupied by all the files and then
X collapse them wherever possible and give the output(this effort is
X time consuming). Our goal was to find the extents that a fileset maps
X to but since you mentioned that the fileset is just a name in a name
X space we probably need to stick to the method you mentioned.
X Continuing on the previous conversation: If we indeed walk thro all
X the files in the fileset and get the file extents we would need to
X find the extents of the special files M-6 and M-12 as well but these
X files are somehow hidden but i am pretty sure that they occupy space
X on the fileset and we need to account for their extent information as
X well. My question was concerns about opening these files and doing a
X showfile on them? Hope i have clarified things.
You are playing in very dangerous territory. Unless you have umounted
all the filesets in the domain, things could move on you behind your
back. balance, defragment, migrate, rmvol, and the act of extending a
file could mess things up.
If you are going to work with an unmounted domain, then you might as
well just do a 'dd' of the volumes and get everything. OK, a 1/2 full
1TB domain would still be faster to backup, if you didn't have to
backup the unused storage, so it may always be better. But the fact
that unless you stop all activity on the domain, AdvFS can and will
move things on you. AdvFS will work perfectly, but you will find you
have a corrupt backup.
As to saving on-disk metadata. Some of it you want, and some of it you
do not want. What you want is ownership, protections, time stamps,
property lists, etc... What you do not want to save is metadata that
keeps track of how AdvFS stores and manages the data on the disk.
The M-6, M-12, etc... are where most of the above information is kept.
While you could back these up by just reading them, you would not want
to restore them as they would contain information that the new domain
you are restoring into would not want.
If it was your intention to have a "Smart dd" where you memorize all
the locations on the disk which have data, back them up, then for a
restore you rebuild the disk from scratch and assume that since you
restored all the used sectors on disk, that the disk is now a usable
domain, that might work (but only if you make sure nothing in the
domain (and that is all the volumes of the domain) changes between the
time you start the "Smart dd" and the time it is finished. Anything
else would most likely result in data corruption and it could even
panic the system when AdvFS chokes trying to mount the restored domain.
If that is your goal, then look at reverse engineering the SBM (Storage
Bitmap) file (M-7 for vol 1, M-13 for vol 2, etc...). But again, I
caution you, the contents of the file can and will change on a running
AdvFS domain, plus the AdvFS development team is free to change the
format of the file between releases (and there have already been
discussions about changing it a future major release). So having your
project depend on the contents of the SBM (and any other AdvFS metadata
file) is a high risk situation.
If your goal is to actually know about every file in the domain without
using supported APIs, then that gets even deeping into reverse
engineering and increases the likelyhood that on any given new release
of Tru64 UNIX something in the AdvFS metadata will change and break
your assumptions about how things work.
And in a previous reply I pointed out APIs that AdvFS supports for
backup utilities (see man 4 advfs, and man fcntl(F_GETMAP), things like
stat()/lstat(), getproplist(), readdir(), etc...).
While I appreciate how time consuming it is to backup huge domains, and
I do not want to discourage anyone from thinking about things from a
different angle, I also do not want to encourage you to create a
product that will fail 6 months, a year, 2 years from now because it
was based on quicksand (ie. changing AdvFS metadata format).
If your company is really serious about creating a new faster better
backup utility for Tru64 UNIX, then the best thing to do is contact our
Product Manager (if you ask off-line, I'll forward his email address).
Bob Harris
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2002-02-08 17:36 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-31 14:42 ADVFS fileset information Narasimha
2002-02-01 9:39 ` Marre des Spameurs qui prennent les add dans les news [SauroN]
2002-02-01 14:28 ` Narasimha
2002-02-04 15:40 ` Bob Harris
2002-02-01 15:15 ` Bob Harris
2002-02-04 16:47 ` Narasimha
2002-02-05 15:18 ` Bob Harris
2002-02-05 21:12 ` Narasimha
2002-02-06 15:18 ` Bob Harris
2002-02-06 22:48 ` Narasimha
2002-02-07 3:21 ` Bob Harris
2002-02-07 13:37 ` Narasimha
2002-02-08 17:36 ` Bob Harris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox