I'm trying to list all files and folder in my external HDD, connected to laptop by using command ls -R > abc.txt
and I get a message as `bash: abc.txt: Read-only file system . kindly help.
1 Answer
You can execute ls -R
on a readonly filesystem, however the file that you are redirecting the output of the command to must be on a writeable filesystem. So in general
ls -R > path/to/writeable/dir/abc.txt
The simplest option is to write to a file in your home directory
ls -R > ~/abc.txt
fsck
or file system check). If it was mounted RO, you need toumount
(unmount) thenmount
(re-mount) it RW (read-write), but a RO file-system is a serious warning sign of problems (unless you mounted it RO). You can't save data to a RO file-system (what the READ ONLY means). You can only save data to a file-system mounted as RW or READ WRITE.