You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 22.04.2 LTS系统下只读驱动器无法创建文件夹及修改路径问题求助

Ubuntu 22.04.2 LTS系统下只读驱动器无法创建文件夹及修改路径问题求助

Hey there, let's work through this read-only drive issue step by step. I've tackled similar problems plenty of times, so here are the most practical fixes to try out:

  • Check the drive's mount status
    First, let's confirm if the drive is actually mounted in read-only mode. Open a terminal and run:

    mount | grep /dev/sdXn
    

    Replace /dev/sdXn with your drive's identifier (you can find it using lsblk or df -hT). Look for the ro flag in the output—if it's there, remount the drive with read-write permissions:

    sudo mount -o remount,rw /dev/sdXn
    

    If you don't know the exact device path, you can also use the mount point (like /mnt/hdd):

    sudo mount -o remount,rw /mnt/hdd
    
  • Verify file system permissions
    If the drive is mounted as rw but you still can't create folders, check the permissions of the mount directory. Run:

    ls -ld /path/to/mount/point
    

    Ensure your user account has write access (look for w in the user or group section). If not, change the ownership to your user:

    sudo chown -R $USER:$USER /path/to/mount/point
    

    For permanent fixes, you can add uid=$(id -u),gid=$(id -g) to the mount options in /etc/fstab so the drive always mounts with your user's permissions.

  • Check for disk errors
    Linux often mounts drives as read-only to prevent data corruption if it detects file system errors. To fix this:

    1. First unmount the drive (skip this if it's your system drive):
      sudo umount /dev/sdXn
      
    2. Run the file system check:
      sudo fsck /dev/sdXn
      

    If it's your system drive, you'll need to boot from a Ubuntu Live USB, then run fsck on the system partition from there—since you can't fix a mounted system drive.

  • Fix /etc/fstab configuration
    If the drive keeps mounting as read-only after reboot, check your /etc/fstab file. Open it with:

    sudo nano /etc/fstab
    

    Look for the line corresponding to your drive. Make sure the mount options include rw (not ro), and verify the UUID is correct (you can get the right UUID with blkid). Save the file (Ctrl+O) and exit (Ctrl+X), then reboot to test.

  • NTFS drive-specific fix
    If your HDD is formatted as NTFS, Ubuntu might mount it as read-only by default if the ntfs-3g package isn't installed. Install it with:

    sudo apt update && sudo apt install ntfs-3g
    

    Then remount the drive, and you should have write access.

备注:内容来源于stack exchange,提问作者Foo127

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.22 14:45:29