File System Type From File Path?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users File System Type From File Path?
# 1  
Old 07-13-2009
File System Type From File Path?

I'm writing a gui for the core utility shred. I want to be able to warn the user if they are about to shred a file that is on a journaled file system. In order to do this, I must learn the file system type of the path they are about to shred.

Is there a way in Unix to:

1. query a specific file to know it's partition? (i.e., /dev/sda2)

2. then, query the partition to know it's file system type? (i.e., ext3, NTFS, etc.)

Possible?
# 2  
Old 07-13-2009
I can tell you how to do it on HPUX...bdf the directory in which you currently are and extract the filesystem mount point and then run fstyp on it to get the filesystem type. ext3 looks like a Linux FS and I have no idea how to get the same info on that platform.
# 3  
Old 07-13-2009
try issuing the command along with the full file path

df -T /path/of/the/file

the -T works for linux, not sure what would work on the various unix flavors... which one are you on?
# 4  
Old 07-14-2009
That's what I was looking for. Thanks rugdog.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How do I add a log file path to a vi file to monitor all the changes made to the file?

I'm curious to know how do I add an empty log file (test1.log) to an existing text file to monitor all the changes made to a.txt. Is this expression export PATH=$PATH:/home/test1.log right to be added to the text file a.txt? (5 Replies)
Discussion started by: TestKing
5 Replies

2. UNIX for Beginners Questions & Answers

Convert Relative path to Absolute path, without changing directory to the file location.

Hello, I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies

3. Shell Programming and Scripting

Shell script to read file and check file type

Hi, I have a file with few values in it. I need script help to read file line by line and check: 1/if it's a file (with extension eg .java .css .jar etc ) or 2/if it's a file without extension and treat it as a directory and then check if the directory exists in working copy else create one... (6 Replies)
Discussion started by: iaav
6 Replies

4. Shell Programming and Scripting

[solved] File type error (not a regular file)

Hi friend, i have written script as below to check the file existance. but i got error path="/k/p1100/users/jewel/Output" FILENAME=`ls -lrt $path/*HT|tail -1|cut -d "/" -f 8` if ; then echo "$FILENAME is available " chmod 755 $path/$FILENAME /usr/bin/scp... (0 Replies)
Discussion started by: Jewel
0 Replies

5. Solaris

Moving a zone path to a new file system

Hello Gurus, I need your help with this please. I am trying to move a zone to a new directory but it keeps failing. Below is what I did and the message I get. Your help will be appreciated. Thanks zoneadm -z testzone move /rpool/testzone cannot create ZFS dataset rpool/testzone: dataset... (1 Reply)
Discussion started by: cjashu
1 Replies

6. Web Development

store images into databases or path to file system files ?

hi, I need a quick information about storing images into mysql databases. Is more convenient to store a path to the filesystem folder in which the images are stored, or is possible to directly store the images into my tables ? thanks (2 Replies)
Discussion started by: aneuryzma
2 Replies

7. UNIX for Advanced & Expert Users

how to findout the file system type?

Hi all, How to findout the file sytem type which is NFS and which is Local? Suppose i have 5 different folders my in Root directory. dir 4 and 5 are mounted on different file system and dir 1,2 and 3 are mounted on different fild system Now i wanted know which file sytem is Local and which... (1 Reply)
Discussion started by: psiva_arul
1 Replies

8. Red Hat

File system type

Hi all, How to find out what type of file system is my system configured for Red hat linux 8.0 ? whether it is NTFS or FAT32 or FAT16... Can somebody help me on this? Regards, William (4 Replies)
Discussion started by: William1482
4 Replies

9. Shell Programming and Scripting

Using 'stat' to determine file system type (with Zenity)

edited and removed (0 Replies)
Discussion started by: mdpalow
0 Replies

10. HP-UX

more than one fs type on the same file system

hi is it possible to have more than one file system types on the same file system. if yes then how do we do it, can veritas be used to achieve this (1 Reply)
Discussion started by: livemyway
1 Replies
Login or Register to Ask a Question