riscv-software-src / riscv-tools

RISC-V Tools (ISA Simulator and Tests)
1.14k stars 447 forks source link

Write permission is disabled #261

Open NilakshanKunananthaseelan opened 5 years ago

NilakshanKunananthaseelan commented 5 years ago

dd if=/dev/zero of=root.bin bs=1M count=64 mkfs.ext2 -F root.bin sudo mount -o loop root.bin mnt

After mount the mnt partition,I'm unable to write inittab file into the etc directory.How can I enable the writing permission to the mnt partition? I have tried these commands sudo chown riscv_group : mnt sudo chmod -R -rwxrw-rw mnt but the results are same.Any suggestions?

jim-wilson commented 5 years ago

These aren't RISC-V questions. They are basic unix questions.

On Tue, Oct 23, 2018 at 11:18 PM knilakshan20 notifications@github.com wrote:

dd if=/dev/zero of=root.bin bs=1M count=64 mkfs.ext2 -F root.bin sudo mount -o loop root.bin mnt

That last command should be /mnt to avoid confusion.

After mount the mnt partition,I'm unable to write inittab file into the etc directory.How can I enable the writing permission to the mnt partition? I have tried these commands sudo chown riscv_group : mnt

I don't think a space before the : is valid. This would only change owner/group for one file /mnt, which doesn't help much. And that would only help if you are in that group. It isn't clear what you are trying to accomplish by this.

sudo chmod -R -rwxrw-rw mnt but the results are same.Any suggestions?

Try using "ls -lt" to look at file permissions, and "ls -ltd" to look at directory permissions. This last command is clearly wrong by the way, since -rw means remove read/write permissions. Maybe you meant to use +rw? You really shouldn't mess with file system permissions this way though, as it will destroy system security. Better is to just do something like "sudo cp inittab /mnt/etc".

Trying to create a root file system by hand is an odd thing to do. You probably should be using some tool to create a root file system that knows how to do it correctly.

Jim