<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Wie kann man das verwendete Dateisystem ermitteln?]]></title><description><![CDATA[<p>Die Frage sagts schon: Wie kann man das verwendete Dateisystem mit dem eine Festplatte, Diskette oder was auch immer formatiert ist, ermitteln? Beispielsweise habe ich eine Festplatte und möchte wissen ob da, ext2 oder ext2, xfs drauf ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/222370/wie-kann-man-das-verwendete-dateisystem-ermitteln</link><generator>RSS for Node</generator><lastBuildDate>Sun, 04 Oct 2026 21:46:31 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/222370.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 11 Sep 2008 16:04:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wie kann man das verwendete Dateisystem ermitteln? on Thu, 11 Sep 2008 16:04:34 GMT]]></title><description><![CDATA[<p>Die Frage sagts schon: Wie kann man das verwendete Dateisystem mit dem eine Festplatte, Diskette oder was auch immer formatiert ist, ermitteln? Beispielsweise habe ich eine Festplatte und möchte wissen ob da, ext2 oder ext2, xfs drauf ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1580408</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1580408</guid><dc:creator><![CDATA[dixidix]]></dc:creator><pubDate>Thu, 11 Sep 2008 16:04:34 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann man das verwendete Dateisystem ermitteln? on Thu, 11 Sep 2008 20:29:31 GMT]]></title><description><![CDATA[<p>nicht mit c++ mitteln, dass gehört in das entsprechende OS-Forum</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1580491</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1580491</guid><dc:creator><![CDATA[vlad_tepesch]]></dc:creator><pubDate>Thu, 11 Sep 2008 20:29:31 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann man das verwendete Dateisystem ermitteln? on Fri, 12 Sep 2008 08:10:23 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>dixidix schrieb:</p>
<blockquote>
<p>Die Frage sagts schon: Wie kann man das verwendete Dateisystem mit dem eine Festplatte, Diskette oder was auch immer formatiert ist, ermitteln? Beispielsweise habe ich eine Festplatte und möchte wissen ob da, ext2 oder ext2, xfs drauf ist.</p>
</blockquote>
<p>Siehe <a href="http://linux.die.net/man/3/getmntent" rel="nofollow">http://linux.die.net/man/3/getmntent</a></p>
<p>MfG,</p>
<p>Probe-Nutzer</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1580672</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1580672</guid><dc:creator><![CDATA[Probe-Nutzer]]></dc:creator><pubDate>Fri, 12 Sep 2008 08:10:23 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann man das verwendete Dateisystem ermitteln? on Fri, 12 Sep 2008 20:41:36 GMT]]></title><description><![CDATA[<p>ich habe das hier gefunden.<br />
<a href="http://www.linuxmanpages.com/man2/statfs.2.php" rel="nofollow">http://www.linuxmanpages.com/man2/statfs.2.php</a></p>
<p>Wie kann man das dann zurückgeben? Etwa so?</p>
<pre><code class="language-cpp">unsigned long getFsType(const char *mountpoint)
{
	struct statfs s;
 	statfs(mountpoint, &amp;s);

	unsigned long type=s.f_type;
	return type;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1581146</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1581146</guid><dc:creator><![CDATA[dixidix]]></dc:creator><pubDate>Fri, 12 Sep 2008 20:41:36 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann man das verwendete Dateisystem ermitteln? on Mon, 15 Sep 2008 09:52:01 GMT]]></title><description><![CDATA[<p>dixidix schrieb:</p>
<blockquote>
<p>ich habe das hier gefunden.<br />
<a href="http://www.linuxmanpages.com/man2/statfs.2.php" rel="nofollow">http://www.linuxmanpages.com/man2/statfs.2.php</a></p>
</blockquote>
<p>Auch ok.</p>
<p>dixidix schrieb:</p>
<blockquote>
<p>Wie kann man das dann zurückgeben? Etwa so?</p>
<pre><code class="language-cpp">unsigned long getFsType(const char *mountpoint)
{
        struct statfs s;
        statfs(mountpoint, &amp;s);

        unsigned long type=s.f_type;
        return type;
}
</code></pre>
</blockquote>
<p>Ja, so geht das, würde ich aber noch kürzer schreiben, wenn da nichts weiter getan wird (aber müsste <em>type (s.f_type)</em> nicht vom Typ <em>long</em> sein (warum <em>unsigned</em>?)):<br />
:</p>
<pre><code class="language-cpp">long getFsType(const char *mountpoint)
{
        struct statfs s;

        statfs(mountpoint, &amp;s);
        return s.f_type
}
</code></pre>
<p>MfG,</p>
<p>Probe-Nutzer</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1582049</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1582049</guid><dc:creator><![CDATA[Probe-Nutzer]]></dc:creator><pubDate>Mon, 15 Sep 2008 09:52:01 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann man das verwendete Dateisystem ermitteln? on Mon, 15 Sep 2008 10:16:47 GMT]]></title><description><![CDATA[<blockquote>
<p>Ja, so geht das, würde ich aber noch kürzer schreiben, wenn da nichts weiter getan wird (aber müsste type (s.f_type) nicht vom Typ long sein (warum unsigned?)):</p>
</blockquote>
<p>Mit unsinged, war das nur so dahin getippt, aber danke für den Tipp.</p>
<blockquote>
<p>wenn da nichts weiter getan wird</p>
</blockquote>
<p>Ich will eigentlich nur eine Ausgabe haben, die mir den Namen des Dateisystems zurückgibt.<br />
Das müsste ich dann wohl irgendwie hiermit verknüpfen.</p>
<pre><code class="language-cpp">File system types:

   ADFS_SUPER_MAGIC      0xadf5
   AFFS_SUPER_MAGIC      0xADFF
   BEFS_SUPER_MAGIC      0x42465331
   BFS_MAGIC             0x1BADFACE
   CIFS_MAGIC_NUMBER     0xFF534D42
   CODA_SUPER_MAGIC      0x73757245
   COH_SUPER_MAGIC       0x012FF7B7
   CRAMFS_MAGIC          0x28cd3d45
   DEVFS_SUPER_MAGIC     0x1373
   EFS_SUPER_MAGIC       0x00414A53
   EXT_SUPER_MAGIC       0x137D
   EXT2_OLD_SUPER_MAGIC  0xEF51
   EXT2_SUPER_MAGIC      0xEF53
   EXT3_SUPER_MAGIC      0xEF53
   HFS_SUPER_MAGIC       0x4244
   HPFS_SUPER_MAGIC      0xF995E849
   HUGETLBFS_MAGIC       0x958458f6
   ISOFS_SUPER_MAGIC     0x9660
   JFFS2_SUPER_MAGIC     0x72b6
   JFS_SUPER_MAGIC       0x3153464a
   MINIX_SUPER_MAGIC     0x137F /* orig. minix */
   MINIX_SUPER_MAGIC2    0x138F /* 30 char minix */
   MINIX2_SUPER_MAGIC    0x2468 /* minix V2 */
   MINIX2_SUPER_MAGIC2   0x2478 /* minix V2, 30 char names */
   MSDOS_SUPER_MAGIC     0x4d44
   NCP_SUPER_MAGIC       0x564c
   NFS_SUPER_MAGIC       0x6969
   NTFS_SB_MAGIC         0x5346544e
   OPENPROM_SUPER_MAGIC  0x9fa1
   PROC_SUPER_MAGIC      0x9fa0
   QNX4_SUPER_MAGIC      0x002f
   REISERFS_SUPER_MAGIC  0x52654973
   ROMFS_MAGIC           0x7275
   SMB_SUPER_MAGIC       0x517B
   SYSV2_SUPER_MAGIC     0x012FF7B6
   SYSV4_SUPER_MAGIC     0x012FF7B5
   TMPFS_MAGIC           0x01021994
   UDF_SUPER_MAGIC       0x15013346
   UFS_MAGIC             0x00011954
   USBDEVICE_SUPER_MAGIC 0x9fa2
   VXFS_SUPER_MAGIC      0xa501FCF5
   XENIX_SUPER_MAGIC     0x012FF7B4
   XFS_SUPER_MAGIC       0x58465342
   _XIAFS_SUPER_MAGIC    0x012FD16D
</code></pre>
<p>Die Funktion gibt ja nur Nummern aus, also müsste ich das dann noch umbiegen. Also das z.B nicht</p>
<pre><code>0xEF53
</code></pre>
<p>sondern</p>
<pre><code>EXT2_SUPER_MAGIC
</code></pre>
<p>rauskommmt.</p>
<p>Was mich nur wundert, dass die hier gleich sind?</p>
<pre><code class="language-cpp">EXT2_SUPER_MAGIC      0xEF53
   EXT3_SUPER_MAGIC      0xEF53
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1582062</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1582062</guid><dc:creator><![CDATA[dixidix]]></dc:creator><pubDate>Mon, 15 Sep 2008 10:16:47 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann man das verwendete Dateisystem ermitteln? on Mon, 15 Sep 2008 11:58:18 GMT]]></title><description><![CDATA[<p>dixidix  schrieb:</p>
<blockquote>
<p>Ich will eigentlich nur eine Ausgabe haben, die mir den Namen des Dateisystems zurückgibt.<br />
Das müsste ich dann wohl irgendwie hiermit verknüpfen.</p>
</blockquote>
<p>Ja, wenn der Name benötigt wird, müsste man das noch in &quot;Klartext übersetzen&quot;.</p>
<p>dixidix  schrieb:</p>
<blockquote>
<p>Was mich nur wundert, dass die hier gleich sind?</p>
</blockquote>
<p>Das bedeutet in der Tat, dass diese beiden Systeme nicht unterscheidbar sind. Wenn du es so genau benötigst, dann solltest du vielleicht doch <em>getmntent</em> verwenden, da soll der Name in <em>mnt_fsname</em> zurückgegeben werden.</p>
<p>MfG,</p>
<p>Probe-Nutzer</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1582113</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1582113</guid><dc:creator><![CDATA[Probe-Nutzer]]></dc:creator><pubDate>Mon, 15 Sep 2008 11:58:18 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann man das verwendete Dateisystem ermitteln? on Mon, 15 Sep 2008 12:06:57 GMT]]></title><description><![CDATA[<p>ext3 ist das selbe wie ext2, oder besser speichert und organisiert die daten auf exakter art und weise wie ext2. der einzigste unterschied besteht darin, dass ext3 noch ein journal auf der platte speichert und verwaltet. da es aber möglich ist ext3 auch als ext2 zu mounten und man auch mit dem ext2 treiber lesend und schreibend zugreifen kann haben sie die gleiche superblock identifikation. um also ext2 und ext3 zu unterscheiden müsstest auf existenz eines journals testen. wie dass aber im detail funktioniert kann ich auch nicht sagen, vielleicht mal in den sourcen von tune2fs stöbern <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1582118</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1582118</guid><dc:creator><![CDATA[sothis_]]></dc:creator><pubDate>Mon, 15 Sep 2008 12:06:57 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann man das verwendete Dateisystem ermitteln? on Mon, 15 Sep 2008 13:00:41 GMT]]></title><description><![CDATA[<p>du kannst die ext3-journal-datei unter /.journal finden. allerdings wird die normalerweise von dem system versteckt, wenn das ganze als ext3 gemountet ist. bei einem mount für ext2 bin ich mir sicher. die datei ist aber auf alle fälle vorhanden, wenn es ext3 ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1582150</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1582150</guid><dc:creator><![CDATA[ghorst]]></dc:creator><pubDate>Mon, 15 Sep 2008 13:00:41 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann man das verwendete Dateisystem ermitteln? on Mon, 15 Sep 2008 14:09:00 GMT]]></title><description><![CDATA[<p>Aha, danke, mal schauen.</p>
<p>edit: erst mal noch etwas als Grundlage, funktionieren tut das zwar, aber egal was man für einen Mountpoint angibt, es kommt immer das gleiche raus und nicht mal das was in der Liste steht.<br />
es wird nur diese Zahl ausgegeben:</p>
<pre><code>16914836
</code></pre>
<p>müsste dann dies hier sein</p>
<pre><code>0x1021994
</code></pre>
<p>Muss hier noch was beachtet werden?</p>
<pre><code class="language-cpp">#include &lt;sys/statfs.h&gt;
#include &lt;iostream&gt;

long getFsType(const char *mountpoint)
{
        struct statfs s;

        statfs(mountpoint, &amp;s);
        return s.f_type;
}

int main( int argc, char **argv)
{
	const char *mp = &quot;/dev/sda&quot;;
	cout&lt;&lt;&quot;Found system &quot;&lt;&lt; getFsType(mp)&lt;&lt;&quot; at &quot; &lt;&lt; mp &lt;&lt;endl;
    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1582175</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1582175</guid><dc:creator><![CDATA[dixidix]]></dc:creator><pubDate>Mon, 15 Sep 2008 14:09:00 GMT</pubDate></item></channel></rss>