Page 1 of 1

Check if a partition have data without mounting

Posted: 2011/09/30 17:00:41
by zzeratul
Friends,


I need to check if a partition have data, but without mount it, because i don't like to produce something wrong on my server.
I installed oracle rac on 2 nodes with CentOS 5. This installation use 20 asm disks, but we have 10 disks that not use asm, and we need to verify if these dont have data.
Regards and sorry for my english.

Thanks

Re: Check if a partition have data without mounting

Posted: 2011/09/30 19:12:20
by TrevorH
How about

[code]
# file -s /dev/sda1
/dev/sda1: Linux rev 1.0 ext3 filesystem data (needs journal recovery)
[/code]

Check if a partition have data without mounting

Posted: 2011/10/01 14:43:32
by pschaff
Building on Trevor's stellar example - to check all partitions:[code]file -s $(fdisk -l | grep ^/dev/ | cut -d ' ' -f 1)[/code]