Check if a partition have data without mounting

Installation and support for Oracle DB on CentOS.
zzeratul
Posts: 1
Joined: 2011/09/30 16:50:17

Check if a partition have data without mounting

Postby zzeratul » 2011/09/30 17:00:41

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

User avatar
TrevorH
Forum Moderator
Posts: 20962
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Check if a partition have data without mounting

Postby TrevorH » 2011/09/30 19:12:20

How about

Code: Select all

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

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Check if a partition have data without mounting

Postby pschaff » 2011/10/01 14:43:32

Building on Trevor's stellar example - to check all partitions:

Code: Select all

file -s $(fdisk -l | grep ^/dev/ | cut -d ' ' -f 1)