> -----Original Message-----
> From: Arik Baratz 
> Sent: Monday, February 17, 2003 7:28 PM
> Subject: RE: Guessing filesystem while unmounted
> 
> 
> > -----Original Message-----
> > From: Uri Itscowits [mailto:[EMAIL PROTECTED]]
> > 
> > Hi there,
> > 
> > I need to guess which is the root filesystem ( on GNU/Linux OC), 
> >   while all partitions are still unmounted.
> > 
> > I could of course mount each in turn, and look for 
> /etc/fstab or so, 
> >   but I am looking for a way which won't involve mounting, if 
> > possible.
> > 
> 
> How about:
> 
> dd if=/dev/hda1 bs=1024 count=10 | file -
> 
> I don't have another type of filesystem to try it on, but for 
> my ext3 ones it works fine even if I decrease count to as low 
> as 2 blocks (for 1 block 'file' doesn't recognize it).
> 
> Disclaimer: No guarentees. Use a modern version of file(1).
> 
> -- Arik

This might let you find out the filesystem's TYPE, but it won't
tell you which of the partitions is supposed to be the root
filesystem. From the responses so far I think the answer is
that this knowledge is in the logic of the boot loader rather
than anywere else.

On Solaris filesystems there is a field per partition which remembers
where it was mounted last, which is very helpful but even that is not quite
definitive (what if you keep multiple root filesystems, e.g. for different
OS versions?)

Maybe if Uri (the original poster) could describe what's the final goal
he is trying to achieve we could come up with a completly different aproach?

Cheers,

--Amos

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to