Switch to using debugreiserfs to read the UUID (#684115)

For a mounted reiserfs file system with a Nil UUID (all zeros) GParted
will display a partition specific warning.  This comes from the reiserfs
specific read_uuid() method.  Error demonstration:

    # blkid /dev/sda15
    /dev/sda15: LABEL="test-reiserfs-2" TYPE="reiserfs"
    # mount | grep sda15
    /dev/sda15 on /mnt/2 type reiserfs (rw,relatime)
    # reiserfstune /dev/sda15
    reiserfstune: Reiserfstune is not allowed to be run on mounted filesystem.

Switch to using debugreiserfs to read the UUID as it can be used on a
mounted file system.

    # debugreiserfs /dev/sda15 2> /dev/null | grep UUI
    UUID: 00000000-0000-0000-0000-000000000000

Bug #684115 - Reiserfs UUID reading issues on Fedora and CentOS
This commit is contained in:
Mike Fleetwood 2012-09-15 22:48:00 +01:00 committed by Curtis Gedak
parent eca986c96d
commit ee87cee96f
1 changed files with 1 additions and 1 deletions

View File

@ -127,7 +127,7 @@ bool reiserfs::write_label( const Partition & partition, OperationDetail & opera
void reiserfs::read_uuid( Partition & partition )
{
if ( ! Utils::execute_command( "reiserfstune " + partition .get_path(), output, error, true ) )
if ( ! Utils::execute_command( "debugreiserfs " + partition .get_path(), output, error, true ) )
{
partition .uuid = Utils::regexp_label( output, "^UUID:[[:blank:]]*(" RFC4122_NONE_NIL_UUID_REGEXP ")" ) ;
}