lundi 2 février 2015

Calculating a File Offset


I would like to know how I could calculate the offset of a certain file in a certain partition. I have spent quite some time looking for an answer but couldn't find anything concrete. What I mean is that if I have a file "/mnt/vgfsxxxx-lvfsxxxx/req/fileName" located on "/dev/mapper/vgfsxxxx-lvfsxxxx" I want to know what the offset for "fileName" is, so I can for instance, use "dd" to to write to this offset. For example, if the offset of fileName is 12228 then I would like to do:


dd if=/dev/urandom of=/dev/mapper/vgfsxxxx-lvfsxxxx bs=4096k count=5 seek=12288


Thanks!



Aucun commentaire:

Enregistrer un commentaire