Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[mount] Auf welchem Device liegen welche Verzeichnisse?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum
View previous topic :: View next topic  
Author Message
3PO
Veteran
Veteran


Joined: 26 Nov 2006
Posts: 1110
Location: Schwabenländle

PostPosted: Thu Nov 01, 2012 2:28 pm    Post subject: [mount] Auf welchem Device liegen welche Verzeichnisse? Reply with quote

Hallo Zusamen,

gibt es eigentlich eine Möglichkeit herauszufinden, auf welchem Laufwerk ein bestimmtes Verzeichnis ist?

Nehmen wir mal an, ich mounte /mnt/foo nach /dev/sdb1 und in /foo gibt es noch Unterverzeichnisse, z.B /mnt/foo/bar.

Wie kann ich nun herausfinden, auf welchem Device "bar" liegt?

Anders gesagt, wenn ich ich frage, "Auf welchen Device liegt bar?", hätte ich gerne als Antwort: "/dev/sdb".

Wie kann ich das am einfachsten lösen?
Back to top
View user's profile Send private message
firefly
Watchman
Watchman


Joined: 31 Oct 2002
Posts: 5165

PostPosted: Thu Nov 01, 2012 3:35 pm    Post subject: Reply with quote

mit df
_________________
Ein Ring, sie zu knechten, sie alle zu finden,
Ins Dunkel zu treiben und ewig zu binden
Im Lande Mordor, wo die Schatten drohn.
Back to top
View user's profile Send private message
3PO
Veteran
Veteran


Joined: 26 Nov 2006
Posts: 1110
Location: Schwabenländle

PostPosted: Thu Nov 01, 2012 3:41 pm    Post subject: Reply with quote

firefly wrote:
mit df

So einfach kann es sein. :lol:

1000 THX @ firefly
Back to top
View user's profile Send private message
firefly
Watchman
Watchman


Joined: 31 Oct 2002
Posts: 5165

PostPosted: Thu Nov 01, 2012 3:55 pm    Post subject: Reply with quote

der hinweis auf df fand ich im ersten treffer bei der google suche mit folgenden such begriffen:

Quote:
linux get device belongs to directory

_________________
Ein Ring, sie zu knechten, sie alle zu finden,
Ins Dunkel zu treiben und ewig zu binden
Im Lande Mordor, wo die Schatten drohn.
Back to top
View user's profile Send private message
3PO
Veteran
Veteran


Joined: 26 Nov 2006
Posts: 1110
Location: Schwabenländle

PostPosted: Thu Nov 01, 2012 4:03 pm    Post subject: Reply with quote

Nur noch der Vollständigkeit halber die Befehlszeile:

Code:
DIRECTORY="/mnt/foo/bar"
df ${DIRECTORY} |grep dev | cut -d " " -f1)
Back to top
View user's profile Send private message
Erdie
Advocate
Advocate


Joined: 20 May 2004
Posts: 2566
Location: Heidelberg - Germany

PostPosted: Fri Nov 02, 2012 10:33 pm    Post subject: Reply with quote

"Auf welchem Device liegt "bar"?"

Code:

df | grep bar

_________________
Desktop AMD Ryzen 9 5900X 32GB RAM, Asus GF GTX 1060.
Notebook Tuxedo Pulse 15 Gen1 AMD Ryzen 7 4800H mit Radeon Vega 7
Raspberry Pi 1 + 2 + 3B+ + Zero W
Back to top
View user's profile Send private message
firefly
Watchman
Watchman


Joined: 31 Oct 2002
Posts: 5165

PostPosted: Sat Nov 03, 2012 5:22 pm    Post subject: Reply with quote

Erdie wrote:
"Auf welchem Device liegt "bar"?"

Code:

df | grep bar

und wenn bar eine Datei ist? Dann bekommst du das damit nicht heraus..
Mit diesem Befehl bekommst du nur heraus, welche device nach bar gemountet wurde.
_________________
Ein Ring, sie zu knechten, sie alle zu finden,
Ins Dunkel zu treiben und ewig zu binden
Im Lande Mordor, wo die Schatten drohn.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum