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 / 是说重新挂载根

posted @   a318013800  阅读(1667)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
历史上的今天:
2017-08-03 网管书籍下载
2017-08-03 网管技术 三层交换机与路由器的区别
点击右上角即可分享
微信分享提示