Could reiserfsprogs display volume labels when doing fsck upon boot?
Recently I've changed a filesystem on one of my patitions from ext3 to reiserfs 3.6.
All of my partitions have labels (hint: "mke2fs -L") so at boot I can easily see which partitions are fsck-ed. So while reformatting my last partition /dev/hda8 as reiserfs 3.6, I've labeled it too (hint: "mkreiserfs -l").
Alas, upon boot reiserfsck never displays a volume label set this way, only:
Reiserfs super block in block 16 on 0x307 of format 3.6 with standard journal
While ext2/ext3 fsck displays a neat message for every partition it checks, like:
BOOT: clean, 62/297256 files, 60311/594405 blocks
So, I wanted to ask you: is adding such a functionality to reiserfsck a good idea? I've tried to add it myself and it turned out to be four lines in one source file (well, two lines actually doing the job, because one line is a comment and another one contains a curly bracket). I have a small patch against reiserfsprogs-3.6.19 (applicable to the 3.6.18 and 3.6.17) ready to be sent.
Now my reiserfsck tests if volume label exists, and in such case displays it like:
SPARE: Reiserfs super block in block 16 on 0x307 of format 3.6 with standard journal
And yes, I know it's cosmetic :-)
But for me it's nice to have. This way my system behaves in a more consistent way. Maintainers I asked from my distribution suggested to ask my question at the source. What is your opinion then, reiserfs people?
Friendly,
Wiktor Wandachowicz
On Friday 14 October 2005 12:40, Wiktor Wandachowicz wrote:
[...]
Quoted 5 lines
Now my reiserfsck tests if volume label exists, and in such case displays it like:
SPARE: Reiserfs super block in block 16 on
0x307of format 3.6 with standard journal
[..]
Quoted 1 line
What is your opinion then, reiserfs people?
I can't speak for the Namesys people, but personally I think it's a brilliant idea!
Ray
Quoted 2 lines · Raymond A. Meijer
I can't speak for the Namesys people, but personally I think it's a brilliant idea!
And now that I think about it...can the same thing be done for Reiser4?
And is it possible to change/create a Reiser4 Label AFTER the Filesystem has been created?
Thanks,
Ray
I think the idea is "basically" great , and I would like to see such a feature in reiser3 & reiser4...
Just IMHO ;)
JP
Selon "Raymond A. Meijer" <[email protected]>:
Quoted 20 lines · Wiktor Wandachowicz
[...]
Quoted 5 lines
Now my reiserfsck tests if volume label exists, and in such case displays it like:
SPARE: Reiserfs super block in block 16 on
0x307of format 3.6 with standard journal[..]
Quoted 1 line
What is your opinion then, reiserfs people?
I can't speak for the Namesys people, but personally I think it's a brilliant idea!
Ray
Quoted 6 lines · <jp.guillemin <at> free.fr> writes:
I think the idea is "basically" great , and I would like to see such a feature in reiser3 & reiser4...
Just IMHO ;)
JP
Well, I've checked the source and actually all the needed data were already in place. I mean: the reiserfs_super_block structure contains the needed s_label field. So I've changed a bit one source file and voila! Now the volume label is shown exactly as I would like it to see.
The whole point is to change the print_super_block function in the reiserfscore/prints.c file, as following:
=== QUOTE BEGIN ===
/* return 1 if this is not super block */
int print_super_block (FILE * fp, reiserfs_filsys_t * fs, char * file_name,
struct buffer_head * bh, int short_print)
{
struct reiserfs_super_block * sb =
(struct reiserfs_super_block *)(bh->b_data);
dev_t rdev;
int format = 0;
__u16 state;
if (!does_look_like_super_block (sb))
return 1;
rdev = misc_device_rdev(file_name);
/* Print volume label if it is non-empty. */
if (sb->s_label[0]) {
reiserfs_warning (fp, "%s: ", sb->s_label);
}
reiserfs_warning (fp, "Reiserfs super block in block %lu on 0x%x of ",
bh->b_blocknr, rdev);
switch (get_reiserfs_format (sb)) {=== QUOTE END ===
For reiserfs-3.6.19, .18 & .17 I just needed to add the following test (I don't have older versions, but I suppose it's also applicable):
/* Print volume label if it is non-empty. */
if (sb->s_label[0]) {
reiserfs_warning (fp, "%s: ", sb->s_label);
}I think I'll send that as a patch to the Namesys, like they say on their
website: http://namesys.com/code.html, with all the needed legal mambo-jumbo
from: http://namesys.com/legalese.html
Vote for this feature enhancement and maybe they will incorporate it mainstream. IMHO it's quick, easy, sane and adds some value at the same time.
I can't say if the same is possible for ReiserFS v.4 because I don't use it.
Friendly,
Wiktor
Quoted 58 lines · Wiktor Wandachowicz
Quoted 8 lines · <jp.guillemin <at> free.fr> writes:
I think the idea is "basically" great , and I would like to see such a feature in reiser3 & reiser4...
Just IMHO ;)
JP
Well, I've checked the source and actually all the needed data were already in place. I mean: the
reiserfs_super_blockstructure contains the neededs_labelfield. So I've changed a bit one source file and voila! Now the volume label is shown exactly as I would like it to see.The whole point is to change the
print_super_blockfunction in thereiserfscore/prints.cfile, as following:=== QUOTE BEGIN ===
/* return 1 if this is not super block */
intprint_super_block(FILE * fp,reiserfs_filsys_t* fs, char *file_name,
structbuffer_head* bh, intshort_print){ struct reiserfs_super_block * sb = (struct reiserfs_super_block *)(bh->b_data); dev_t rdev; int format = 0; __u16 state; if (!does_look_like_super_block (sb)) return 1; rdev = misc_device_rdev(file_name); /* Print volume label if it is non-empty. */ if (sb->s_label[0]) { reiserfs_warning (fp, "%s: ", sb->s_label); } reiserfs_warning (fp, "Reiserfs super block in block %lu on 0x%x of ", bh->b_blocknr, rdev); switch (get_reiserfs_format (sb)) {=== QUOTE END ===
For reiserfs-3.6.19, .18 & .17 I just needed to add the following test (I don't have older versions, but I suppose it's also applicable):
/* Print volume label if it is non-empty. */ if (sb->s_label[0]) { reiserfs_warning (fp, "%s: ", sb->s_label); }I think I'll send that as a patch to the Namesys, like they say on their
website: http://namesys.com/code.html, with all the needed legal mambo-jumbo
from: http://namesys.com/legalese.html
Quoted 10 lines
Vote for this feature enhancement and maybe they will incorporate it mainstream. IMHO it's quick, easy, sane and adds some value at the same time.
I can't say if the same is possible for ReiserFS v.4 because I don't use it.
Friendly,
Wiktor
I've found this method in Reiser4 sources
reiser4_master_get_label(fs->master)
And I am assuming this function from libreiser4/master.c /* Reads master super block from disk */ reiser4_master_t *reiser4_master_open(aal_device_t *device) {
would be where to call the reiser4_master_get_label method...I'll try to modify the code and see if my assumptions are correct.
Yiannis.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________
Quoted 24 lines · Wiktor Wandachowicz
Recently I've changed a filesystem on one of my patitions from ext3 to reiserfs 3.6.
All of my partitions have labels (hint: "mke2fs -L") so at boot I can easily see which partitions are fsck-ed. So while reformatting my last partition
/dev/hda8as reiserfs 3.6, I've labeled it too (hint: "mkreiserfs -l").Alas, upon boot reiserfsck never displays a volume label set this way, only:
Reiserfs super block in block 16 on
0x307of format 3.6 with standard journalWhile ext2/ext3 fsck displays a neat message for every partition it checks, like:
BOOT: clean, 62/297256 files, 60311/594405 blocks
So, I wanted to ask you: is adding such a functionality to reiserfsck a good idea? I've tried to add it myself and it turned out to be four lines in one source file (well, two lines actually doing the job, because one line is a comment and another one contains a curly bracket). I have a small patch against reiserfsprogs-3.6.19 (applicable to the 3.6.18 and 3.6.17) ready to be sent.
Now my reiserfsck tests if volume label exists, and in such case displays it like:
Quoted 8 lines
SPARE: Reiserfs super block in block 16 on
0x307of format 3.6 with standard journalAnd yes, I know it's cosmetic :-)
But for me it's nice to have. This way my system behaves in a more consistent way. Maintainers I asked from my distribution suggested to ask my question at the source. What is your opinion then, reiserfs people?
ok, I will add it.
Signature · 1 line
Vitaly
On Friday 14 October 2005 15:07, Vitaly Fertman wrote:
[...]
Quoted 1 line
ok, I will add it.
Vitaly, is it possible to add labels to Reiser4 filesystems AFTER mkfs, or only during mkfs?
Thanks,
Ray
Quoted 8 lines · Raymond A. Meijer
On Friday 14 October 2005 15:07, Vitaly Fertman wrote:
[...]
Quoted 1 line
ok, I will add it.
Vitaly, is it possible to add labels to Reiser4 filesystems AFTER mkfs, or only during mkfs?
only on mkfs time for now.
Signature · 1 line
Vitaly
Quoted 12 lines · Vitaly Fertman
Quoted 9 lines · Raymond A. Meijer
On Friday 14 October 2005 15:07, Vitaly Fertman wrote:
[...]
Quoted 3 lines
ok, I will add it.
Quoted 9 lines
Quoted 4 lines
Vitaly, is it possible to add labels to Reiser4 filesystems AFTER mkfs, or only during mkfs?
only on mkfs time for now.
For reiser4, would this do it?
in function *reiser4_master_open(aal_device_t *device) in libreiser4/master.c
/* Reiser4 master super block is not found on the device. */
if (aal_strncmp(SUPER(master)->ms_magic, REISER4_MASTER_MAGIC,
sizeof(REISER4_MASTER_MAGIC)) != 0)
{
aal_fatal("Wrong magic found in the master "
"super block.");
goto error_free_master;
}
/* Print volume label */
aal_mess(reiser4_master_get_label(master));return master;
error_free_master:
aal_free(master);
return NULL;Stab in the dark :P
Quoted 38 lines · Yiannis Mavroukakis
Quoted 12 lines · Vitaly Fertman
Quoted 9 lines · Raymond A. Meijer
On Friday 14 October 2005 15:07, Vitaly Fertman wrote:
[...]
Quoted 3 lines
ok, I will add it.
Quoted 9 lines
Quoted 4 lines
Vitaly, is it possible to add labels to Reiser4 filesystems AFTER mkfs, or only during mkfs?
only on mkfs time for now.
For reiser4, would this do it?
in function *reiser4_master_open(aal_device_t *device) inlibreiser4/master.c/* Reiser4 master super block is not found on the device. */ if (aal_strncmp(SUPER(master)->ms_magic, REISER4_MASTER_MAGIC, sizeof(REISER4_MASTER_MAGIC)) != 0) { aal_fatal("Wrong magic found in the master " "super block."); goto error_free_master; } /* Print volume label */ aal_mess(reiser4_master_get_label(master));
Quoted 8 lines
return master;
error_free_master:aal_free(master); return NULL;Stab in the dark :P
I would put it into fsck after fs gets opened to not force all callers to get this message.
however, 'fsck.reiser4 -a' does not perform any check yet and does not even open fs.
Signature · 1 line
Vitaly
Quoted 22 lines · Vitaly Fertman
Quoted 22 lines
For reiser4, would this do it?
in function *reiser4_master_open(aal_device_t *device) inlibreiser4/master.c/* Reiser4 master super block is not found on the device. */
if (aal_strncmp(SUPER(master)->ms_magic, REISER4_MASTER_MAGIC, sizeof(REISER4_MASTER_MAGIC)) != 0) { aal_fatal("Wrong magic found in the master " "super block."); goto error_free_master; } /* Print volume label */ aal_mess(reiser4_master_get_label(master)); return master;
error_free_master:aal_free(master); return NULL;
Quoted 8 lines
Quoted 3 lines
Stab in the dark :P
I would put it into fsck after fs gets opened to not force all callers to get this message. however, 'fsck.reiser4 -a' does not perform any check yet and does not even open fs.
Hello Vitaly,
Thanks for the info. Here is where I show my ignorance so bear with me..Can the caller be "identified" somehow? Say for example, a mount operation or an fsck, then output the system label if there is one..or does this sort of cosmetic touch not fit in libreiser?
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________