• changing permissions of Read-only file system in linux


     

    i use this command to make a bootable flash disk of linux mint

     sudo dd if=~/Desktop/linuxmint.iso of=/dev/sdx oflag=direct  bs=1048576
    

    it's work, but now my flash disk is lock and i can't change file on it now this file is on flash disk

    dr-xr-xr-x 1 ahmad ahmad  2048 May  13 02:24 boot
    dr-xr-xr-x 1 ahmad ahmad  2048 May  13 02:24 casper
    dr-xr-xr-x 1 ahmad ahmad  2048 May  13 02:23 dists
    dr-xr-xr-x 1 ahmad ahmad  2048 May  13 02:24 EFI
    dr-xr-xr-x 1 ahmad ahmad  8192 May  13 02:24 isolinux
    -r--r--r-- 1 ahmad ahmad 21495 May  13 02:24 MD5SUMS
    dr-xr-xr-x 1 ahmad ahmad  2048 May  13 02:23 pool
    dr-xr-xr-x 1 ahmad ahmad  2048 May  13 02:24 preseed
    -r--r--r-- 1 ahmad ahmad   220 May  13 02:24 README.diskdefines
    

    i try sudo chmod 777 * on my disk but it don't work

    migrated from stackoverflow.com Jul 14 '14 at 8:09

    This question came from our site for professional and enthusiast programmers.

    up vote 2 down vote accepted

    However you can write your resulting /dev/sdX device. After you are done with dd as you mentioned you can mount /dev/sdX as RW when you didn't boot you system from this device.

    • If you have already mounted this device, and it is Read Only, you can remount it in RW by

    sudo mount -o remount,rw /dev/sdX , but it works only if you are not running your / system from this partition. Check the partitions mounted with mount -l. Well, actually running OS from this device you will see that the file system changes that you have done can be seen during the sessionm but it's a kind of illusion, they will no be written to the disk.

    • If you need to have a different data set in the iso file, you need it to mount, copy this data, modify and then make a new ISO by something like.

    mkisofs -o /tmp/cd.iso /tmp/directory/ To make an ISO from files on your hard drive.

    • If you need to make a bootable USB drive from your image: choose either Startup Disk Creator or UNetbootin. And if you want to make changes to be saved after you worked in OS on you USB drive you need to tell about persistence to these programs at the disc creation stage.

    in Startup Disk Creator:

    enter image description here

    enter image description here

    in UNetbootin:

    enter image description here

    You can't change permissions nor alter any data in an ISO 9660 filesystem since it's read-only by nature. Despite this you can opt to somehow update data on it if your record format supports multiple sessions. The only thing to consider is that can't change it the normal way in the UNIX filesystem. You may find this howto helpful. Directly creating a new ISO image than having multiple sessions may also be a better practice. The only thing is that it's complicated when you're creating an isolinux-bootable one.

    add a comment

    https://superuser.com/questions/782847/changing-permissions-of-read-only-file-system-in-linux

    ##############################################################################################################################

    #################################################################################################################################

    错误:chmod: changing permissions of ‘/etc/passwd': Read-only file system

    给passwd文件加权限,修改/etc/passwd目录下所有的文件夹属性为可写可读可执行,执行以下命令:chomd 777 /etc/passwd

    的时候提示错误:

    chmod: changing permissions of ‘/etc/passwd': Read-only file system

     

     

    解决方法:

    产生这个问题的原因是文件系统此时处于只读模式下,/etc/passwd和/etc/shadow不能被修改,运行下面的命令就可以解决这个问题

    #mount -rw -o remount /

    注:

      mount 是挂载命令

      -rw  是说指定的挂载文件是可读/写的

      -o remount / 是说重新挂载根

  • 相关阅读:
    Fix the Package System is Broken error in Ubuntu
    linux源镜像网站
    VS2010快捷键大全
    自定义函数与存储过程的比较
    vbcr,vblf和 vbcrlf之间的区别?
    GridView序号问题
    Outlook2007设置备份账号、联系人和个性签名的方法
    c#.net4.0利用odac连接oracle取数
    无法打开登录所请求的数据库DbName 。登录失败。 用户 'IIS APPPOOL\DefaultAppPool' 登录失败。 的解决方案
    C#开发和调用Web Service
  • 原文地址:https://www.cnblogs.com/pengmn/p/9414891.html
Copyright © 2020-2023  润新知