Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QStorageInfo in read only rootfs

QStorageInfo in read only rootfs

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 179 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jignesh Patel
    wrote on last edited by
    #1

    Hi,

    I am using qt revision 5.7.1 on my debian strech system. I have mounted my rootfs as read only ,I have used QStorageInfo to check my SD card size.

    After mounting rootfs as read only i am getting only root directory in QStorageInfo mountedvolumes.

    Below is the source code to get storage list:

    foreach (const QStorageInfo &storage, QStorageInfo::mountedVolumes()) {
        if (storage.isValid() && storage.isReady())
            {
                qDebug() << "storage path" << storage.rootPath();
                qDebug()  << "storage name" << storage.name();
                qDebug()  << "storage readonly" << storage.isReadOnly();
                qDebug()  << "storage filesystem type " << storage.fileSystemType();
                qDebug()  << "storage device " << storage.device();
        }
    }
    

    output of above source :
    storage path "/"
    storage name ""
    storage readonly true
    storage filesystem type ""
    storage device ""

    my /etc/fstab file contain:

    /dev/mmcblk0p1 / ext4 ro,noatime 0 1
    mount_overlay /var fuse nofail,defaults 0 0
    mount_overlay /home fuse nofail,defaults 0 0
    mount_overlay /etc fuse nofail,defaults 0 0
    none /tmp tmpfs defaults 0 0

    If I mount rootfs as "rw" QStorageInfo works fine.

    Please help me understand issue QStorageInfo with readonly rootfs.

    Thanks,
    Jignesh Patel

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved