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 / 是說重新掛載根


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM