Re: [gentoo-user] How to determine if a partition is formated

2006-02-12 Thread Iain Buchanan
On Sat, 2006-02-11 at 07:26 -0600, John Jolet wrote:
 Iain Buchanan wrote:
  On Fri, 2006-02-10 at 14:03 -0800, Mike Owen wrote:
  On 2/10/06, John Jolet [EMAIL PROTECTED] wrote:
   Fdisk -l
 
  no!!!
 
  Even easier:
  waldo# file -s /dev/sdb1
  /dev/sdb1: SGI XFS filesystem data (blksz 4096, inosz 256, v2 dirs)
 
  are you sure?  At least for fdisk, (and maybe for 'file' as well) this
  will just show what you've told the partition it is.
 
 hmm, hadn't considered you'd lie to fdisk.  You are correct, i'm sure,
 though lying to fdisk might have some consequences you don't like.  I
 guess I'm not sure why you don't just mount the puppy.

I would never dream of lying to the mighty fdisk ;) However, what
happens when you plug an unknown usb disk into a machine?  You don't
know what the partitions are, or what's been done to it.  If the OP was
writing a script to mount an unknown partition, IMHO looking at fdisk is
not the right way.

You can't just mount the puppy either (and let mount do the work)
because if you want to give options to mount, you also have to specify
-t type.

It's good to know that file actually looks at the data, and not the
partition table.
-- 
Iain Buchanan iain at netspace dot net dot au

If you go on with this nuclear arms race, all you are going to do is
make the rubble bounce.
-- Winston Churchill

-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] How to determine if a partition is formated

2006-02-12 Thread Rohit Sharma
Iain Buchanan wrote:

You can't just mount the puppy either (and let mount do the work)
  

Are you sure?
While using Gentoo's  installation disks, I have successfully mounted
the disk partitions without caring to tell the installation linuxrc as
to what formatting was provided.
it mounted reiserfs, vfat and xfs every time.
that may be one workaround. Boot your comp with installation disk, let
the media detect what you have on your comp,  do a file on it or mount
it. xfs, ext2/3 and reiserfs tell you at the time of mounting if they
are there.
Mounting is silent for vfat. No idea about NTFS though...

HTH,
Rohit
-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] How to determine if a partition is formated

2006-02-12 Thread Iain Buchanan
On Mon, 2006-02-13 at 09:53 +, Rohit Sharma wrote:
 Iain Buchanan wrote:
 
 You can't just mount the puppy either (and let mount do the work)
   
 
 Are you sure?
 While using Gentoo's  installation disks, I have successfully mounted
 the disk partitions without caring to tell the installation linuxrc as
 to what formatting was provided.

are _you_ sure? (that you also specified -o ?)

as I said, you _can_ use mount /what /where, but you can't say
mount -o opts /what /where, you have to say
mount -t type -o opts /what /where...

and if you don't know -t type, (and if you are a script) then what?  Use
disktype!!

 it mounted reiserfs, vfat and xfs every time.
 that may be one workaround. Boot your comp with installation disk, let
 the media detect what you have on your comp,  do a file on it or mount
 it. xfs, ext2/3 and reiserfs tell you at the time of mounting if they
 are there.

not very efficient...

-- 
Iain Buchanan iain at netspace dot net dot au

To be or not to be, that is the bottom line.

-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] How to determine if a partition is formated

2006-02-11 Thread John Jolet

Iain Buchanan wrote:
 On Fri, 2006-02-10 at 14:03 -0800, Mike Owen wrote:
 On 2/10/06, John Jolet [EMAIL PROTECTED] wrote:
  Fdisk -l

 no!!!

 Even easier:
 waldo# file -s /dev/sdb1
 /dev/sdb1: SGI XFS filesystem data (blksz 4096, inosz 256, v2 dirs)

 are you sure?  At least for fdisk, (and maybe for 'file' as well) this
 will just show what you've told the partition it is.

hmm, hadn't considered you'd lie to fdisk.  You are correct, i'm sure,
though lying to fdisk might have some consequences you don't like.  I
guess I'm not sure why you don't just mount the puppy.

 What happens if you mark a partition with fdisk as type, say, fat32, and
 then run mkfs.ext3 over it?  fdisk -l will show fat32, file will
 do .?

 There are other tools to help you, like disktype:
 *  sys-block/disktype
   Latest version available: 8
   Latest version installed: 8
   Size of downloaded files: 39 kB
   Homepage:http://disktype.sourceforge.net/
   Description: Detect the content format of a disk or disk image.
   License: BSD

 HTH,
 --
 Iain Buchanan iain at netspace dot net dot au

 Bumper sticker:
   All the parts falling off this car are of the very finest
   British manufacture.

 --
 gentoo-user@gentoo.org mailing list




-- 
John Jolet
Your On-Demand IT Department
512-762-0729
[EMAIL PROTECTED]
www.jolet.net
-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] How to determine if a partition is formated

2006-02-11 Thread John Myers
On Friday 10 February 2006 20:05, Iain Buchanan wrote:
 are you sure?  At least for fdisk, (and maybe for 'file' as well) this
 will just show what you've told the partition it is.


'file' determines filetypes primarily by looking for 'magic numbers' within 
the file, so 'file' should indeed identify the proper type of filesystem. In 
fact, if you have a filesystem in a regular file (such as a disk image), it 
will still properly identify the filesystem.

-- 
# 
# electronerd, the electronerdian from electronerdia
#


pgp9gQYFGR67f.pgp
Description: PGP signature


[gentoo-user] How to determine if a partition is formated

2006-02-10 Thread acaudel
Is there a way to determine if a partition is formated, and the type 
of formating, other than trying to mount it?
-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] How to determine if a partition is formated

2006-02-10 Thread John Jolet
Fdisk -l


On 2/10/06 3:41 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Is there a way to determine if a partition is formated, and the type
 of formating, other than trying to mount it?


-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] How to determine if a partition is formated

2006-02-10 Thread Mike Owen
On 2/10/06, John Jolet [EMAIL PROTECTED] wrote:
 Fdisk -l



Even easier:
waldo# file -s /dev/sdb1
/dev/sdb1: SGI XFS filesystem data (blksz 4096, inosz 256, v2 dirs)

-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] How to determine if a partition is formated

2006-02-10 Thread Iain Buchanan
On Fri, 2006-02-10 at 14:03 -0800, Mike Owen wrote:
 On 2/10/06, John Jolet [EMAIL PROTECTED] wrote:
  Fdisk -l

no!!!

 Even easier:
 waldo# file -s /dev/sdb1
 /dev/sdb1: SGI XFS filesystem data (blksz 4096, inosz 256, v2 dirs)

are you sure?  At least for fdisk, (and maybe for 'file' as well) this
will just show what you've told the partition it is.

What happens if you mark a partition with fdisk as type, say, fat32, and
then run mkfs.ext3 over it?  fdisk -l will show fat32, file will
do .?

There are other tools to help you, like disktype:
*  sys-block/disktype
  Latest version available: 8
  Latest version installed: 8
  Size of downloaded files: 39 kB
  Homepage:http://disktype.sourceforge.net/
  Description: Detect the content format of a disk or disk image.
  License: BSD

HTH,
-- 
Iain Buchanan iain at netspace dot net dot au

Bumper sticker:
All the parts falling off this car are of the very finest
British manufacture.

-- 
gentoo-user@gentoo.org mailing list