Read Only Partition

Post Reply
kpadilha
Posts: 5
Joined: Thu Jul 28, 2011 11:34 pm

Read Only Partition

Post by kpadilha » Thu Jul 28, 2011 11:37 pm

Hi All

I was wandering if anyone is having the same problem than me:

I've followed the ssh/root guide and now I can access my cloud edition drive. But the system partition is read only.
Anyone knows how to change this?

Thanks.
Krishna

Mijzelf
Posts: 6251
Joined: Mon Jun 16, 2008 10:45 am

Re: Read Only Partition

Post by Mijzelf » Fri Jul 29, 2011 7:27 am

According to this mount-dump only the directories /mnt/apps and /oem are read-only. IS that different on yours?
/mnt/apps is ext2, so it can be made rw, by remounting it:

Code: Select all

mount /dev/loop0 /mnt/apps -o remount,rw
BUT, it is possible that the firmware has a checksum on the partition, and will automatically revert or reject on boot.
/oem is cramfs, that is read-only by design. With some effort you could create another cramfs-file with other contents.

kpadilha
Posts: 5
Joined: Thu Jul 28, 2011 11:34 pm

Re: Read Only Partition

Post by kpadilha » Sat Jul 30, 2011 1:32 am

Thank you! But it does not work.
When I try the command i get:

Code: Select all

root@IO-Backup:/# mount /dev/loop0 /mnt/apps -o remount,rw -t ext2
mount: block device /dev/loop0 is write-protected, mounting read-only

Mijzelf
Posts: 6251
Joined: Mon Jun 16, 2008 10:45 am

Re: Read Only Partition

Post by Mijzelf » Sat Jul 30, 2011 9:31 am

Ah, I see. In that case the loop device itself is read-only. (losetup -r). AFAIK there is no way to change that, you can only re-create the loop device:

Code: Select all

umount /dev/loop0
losetup -d /dev/loop0
losetup /dev/loop0 /sysroot/boot/images/apps
mount /dev/loop0 /mnt/apps
But I don't know if it will be possible to unmount loop0, it could be busy. In that case you'll have to kill all processes which have a file open on this device (maybe 'lsof | grep /mnt/apps' can tell you which they are), or you can search for the place where the loopdevice is created (maybe somewhere in /etc, or in /sbin/init, or in /rclinux) and remove the -r in the losetup line. (If the script is on a writable device), and reboot.

marcusvnac
Posts: 4
Joined: Sat Jul 09, 2011 11:07 pm

Re: Read Only Partition

Post by marcusvnac » Thu Sep 15, 2011 12:48 am

I'm with this same problem.

I'm looking for update de Twonky to last version, but I don't have access to overwrite the files.

Any suggestion?

timblack1
Posts: 4
Joined: Sat May 19, 2012 10:14 pm

Re: Read Only Partition

Post by timblack1 » Sun May 20, 2012 1:39 am

Mijzelf wrote:Ah, I see. In that case the loop device itself is read-only. (losetup -r). AFAIK there is no way to change that, you can only re-create the loop device:

Code: Select all

umount /dev/loop0
At this point I get an error, so I issued

Code: Select all

umount -l /dev/loop0
which runs without error, but then the "mount" and "ls" bash commands don't work anymore, because they are provided by /dev/loop0. Maybe what I have to do is mount /dev/loop0 on another mount point, then add that mount point's /bin subdirectory to my path so I can still use the mount command. Is this the right way to do it?
Mijzelf wrote:or you can search for the place where the loopdevice is created (maybe somewhere in /etc, or in /sbin/init, or in /rclinux) and remove the -r in the losetup line. (If the script is on a writable device), and reboot.
I wasn't able to find that location. I was able to find the following:

Code: Select all

sh-3.2# cat /sbin/init | grep "losetup"
sh-3.2# grep -rHn "losetup" /etc
sh-3.2# ls /rclinux
ls: cannot access /rclinux: No such file or directory
sh-3.2# whereis rclinux
rclinux:
sh-3.2# ls -la /sbin/init
lrwxrwxrwx 1 root root 14 Mar 13 12:35 /sbin/init -> /ram/sbin/init
sh-3.2# cat /sbin/init | grep "/dev/loop0"
sh-3.2#
sh-3.2# grep -rHn "/dev/loop0" /etc
/etc/mtab:5:/dev/loop0 /mnt/apps ext2 ro,relatime 0 0
sh-3.2# ls -la /etc/mtab
lrwxrwxrwx 1 root root 12 Dec 31  1969 /etc/mtab -> /proc/mounts
sh-3.2# ls -la /proc/mounts
lrwxrwxrwx 1 root root 11 May 19 20:05 /proc/mounts -> self/mounts
sh-3.2# cat /proc/self/mounts
rootfs / rootfs rw 0 0
/dev/root.old /initrd ext2 rw,relatime,errors=continue 0 0
none / tmpfs rw,relatime,size=51200k,nr_inodes=31939 0 0
/dev/md0_vg/BFDlv /boot ext2 rw,noatime,errors=continue 0 0
/dev/loop0 /mnt/apps ext2 ro,relatime 0 0
/dev/loop1 /etc ext2 rw,sync,noatime 0 0
/dev/loop2 /oem cramfs ro,relatime 0 0
proc /proc proc rw,relatime 0 0
none /proc/bus/usb usbfs rw,relatime 0 0
none /sys sysfs rw,relatime 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620 0 0
tmpfs /mnt/apps/lib/init/rw tmpfs rw,nosuid,relatime,mode=755 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0
/dev/mapper/md0_vg-vol1 /mnt/system xfs rw,noatime,attr2,logbufs=8,noquota 0 0
/dev/mapper/6bc3f4b1_vg-lv74cab4af /mnt/pools/A/A0 xfs rw,noatime,attr2,nobarrier,logbufs=8,noquota 0 0
But (normally, on other systems) /etc/mtab is merely a report of what filesystems are mounted, and is not the file that instructs the NAS to mount /dev/loop0 as read-only.

Mijzelf
Posts: 6251
Joined: Mon Jun 16, 2008 10:45 am

Re: Read Only Partition

Post by Mijzelf » Mon May 21, 2012 7:07 pm

timblack1 wrote:Maybe what I have to do is mount /dev/loop0 on another mount point, then add that mount point's /bin subdirectory to my path so I can still use the mount command.
When I'm not mistaken, /bin, /lib and /sbin are symlinks. So you could copy their contents to the data partitions, and edit the symlinks, before unmounting /dev/loop0.

NyNe
Posts: 1
Joined: Thu Aug 15, 2013 6:52 pm

Re: Read Only Partition

Post by NyNe » Thu Aug 15, 2013 6:55 pm

anyone ever figure out a solution to this? this seems to be the only thing standing in my way (as of now) to make this drive a bit more powerful

doblecero
Posts: 1
Joined: Mon Feb 23, 2015 6:36 pm

Re: Read Only Partition

Post by doblecero » Fri Apr 13, 2018 12:15 pm

Has a solution ever found for this?

thanks!

Post Reply