[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ogfs-dev]Journal info ... device number



"Cahill, Ben M" wrote:

>
>
> > > > Wouldn't a device *number* potentially change from time to time?
> > >
> > > Possibly.
> >
> > Major numbers in the official kernel tree are defined in
> > Documentation/devices.txt. They don't change.
> > It is possible to request dynamic (unused) major numbers during device
> > registration. This should be used in private
> > device drivers only.
> > The minor numbers are managed by the device drivers, chaos
> > would reign in
> > ext3 if these numbers change.
>
> I'm mystified . . . minor numbers might not change during a Linux session (between boot up and shutdown), but I'm pretty sure they can change due to adding/removing devices, etc. between sessions . . . that's a problem that pool and EVMS solve, presenting a consistent /dev name even if the numbers change (they both write a header on the disk to identify the disk, no matter what its device number is ... the header is persistent across reboots).

Device names may change, but why should the minor number change? If you add a new device,
it usually has a different major number. If you add a new partition a new minor number is assigned
in ascending order, for example:
/dev/hda1 has major,minor 3,1
/dev/hda2 3,2
/dev/hdaN 3,N
/dev/hdb1 3, 65
/dev/hdc 22,0

>
> Looking at man page for mke2fs (RedHat 8.0), it says you can specify an external journal by one of 3 ways:
>
> -- device name
> -- volume label
> -- UUID (stored in ext2 superblock on journal device)
>
> The device name might not be persistent between boots (any more than a minor number might be), but the other two should be.
>
> If the superblock contains a device number, might it be written to the superblock at mount time???

I took another look at the filesystem code of the ext3 mount process(->ext3_read_super):
First the ext3_super_block is read from disk, then the journal device is accessed using the
s_journal_dev member of the ext3_super_block structure (the one read from disk, ->ext3_load_journal).
The journal device superblock is read from disk and the ext3_super_block->s_journal_uuid of the filesystem
is checked against the uuid of the journal device ext3_super_block (->ext3_get_dev_journal), to make
sure the right journal is used.

Stefan







-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Opengfs-devel mailing list
Opengfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opengfs-devel

[Kernel]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Clusters]     [Linux RAID]     [Yosemite Hiking]     [Linux Resources]

Powered by Linux