0

I have a NAS Lenovo Iomega Store IX2-200 Cloud Edition running Debian 7 and a Twonky Media Server and I'm having 2 problems.

1) I need to modify the twonky configuration file /usr/local/twonky/twonkyvision-mediaserver.ini but the file is read-only. I'm logged as root and can't modify or even do chown root to this file. The system returns the error "Read-only file system".

root@ix2:/# chown root /usr/local/twonky/twonkyvision-mediaserver.ini
chown: changing ownership of `/usr/local/twonky/twonkyvision-mediaserver.ini': Read-only file system

2) Aptitude and apt-get doesn't work and the following errors are returned:

root@ix2:/usr/local/twonky# aptitude update
E: Could not open lock file /var/lib/dpkg/lock - open (2: No such file or directory)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
E: Could not open file /var/lib/dpkg/status - open (2: No such file or directory)
E: The package lists or status file could not be parsed or opened.

Thats wierd because I'm root and the systems is asking if i'm root.

The /var/lib/dpkg/ doesn't exist and I can't make it and use aptitude or apt-get.

When I try aptitude it says: root@ix2:/# aptitude update E: Write error - write (28: No space left on device) E: Can't mmap an empty file E: Failed to truncate file - ftruncate (9: Bad file descriptor) E: The package lists or status file could not be parsed or opened. E: Could not open file /var/lib/dpkg/status - open (2: No such file or directory) E: The package lists or status file could not be parsed or opened.

my disk is almost empty

What can I do?

  • 3
    Sounds like the filesystem is mounted read-only, either due to design or some error ... what is in /etc/fstab and what does the mount command give for output? – ivanivan Feb 6 '17 at 2:47
  • Your disk is full. – Basile Starynkevitch Feb 6 '17 at 6:47
  • @ivanivan # /etc/fstab: static file system information. # # <file system> <mount pt> <type> <options> <dump> <pass> /dev/root / ext2 rw,noauto 0 1 proc /proc proc defaults 0 0 none /proc/bus/usb usbfs defaults 0 0 none /proc/fs/nfsd nfsd defaults 0 0 none /sys sysfs defaults 0 0 devpts /dev/pts devpts defaults,gid=5,mode=620 0 0 /mnt/system/swapfile swap swap defaults 0 0 – Lorenço Santos Feb 9 '17 at 14:53
  • and the mount command returned root@ix2:/# mount /dev/root.old on /initrd type ext2 (rw,relatime,errors=continue) none on / type tmpfs (rw,relatime,size=51200k,nr_inodes=30949) /dev/md0_vg/BFDlv on /boot type ext2 (rw,noatime,sync,errors=continue) /dev/loop0 on /mnt/apps type ext2 (ro,relatime) /dev/loop1 on /mnt/etc type ext2 (rw,noatime,sync) none on /etc type unionfs (rw,noatime,sync,dirs=/mnt/etc=rw:/mnt/apps/etc=ro) /dev/loop2 on /oem type squashfs (ro,relatime) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) none on /proc/bus/usb type usbfs (rw,relatime) – Lorenço Santos Feb 9 '17 at 14:57
  • continued: none on /proc/fs/nfsd type nfsd (rw,relatime) none on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620) tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=24776k,mode=755) tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k) tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=49540k) /dev/mapper/md0_vg-vol1 on /mnt/system type ext4 (rw,noatime,barrier=1,data=ordered) – Lorenço Santos Feb 9 '17 at 14:58
1

A read only filesystem is one filesystem that has been mounted readonly or that due to a improper shutdown needs repair. Linux makes this automatically for filesystems when it finds some inconsistency that must be repaired manually by the administrator (possible filesystem data corruption). Run fsck(1) on that filesystem to see if some repair has to be done. If a filesystem is mounted read-only, even root user is unable to modify files on it.

| improve this answer | |
  • Hi! Run root@ix2:/# fsck(1) -sh: syntax error near unexpected token '1' and root@ix2:/# fsck fsck 1.42.5 (29-Jul-2012) e2fsck 1.42.5 (29-Jul-2012) fsck.ext2: No such file or directory while trying to open /dev/root Possibly non-existent device? – Lorenço Santos Feb 9 '17 at 14:50
0

Hacking a Debian based NAS

A Iomega prepare a limited debian installation, stored in raw disk images, located on /boot (hit losetup -a too see loop binds). you could either:

  1. modify images stored in /boot, it's a strong work and if you do some error, you'r nas will become unuseable.

  2. Don't touch anything in /boot but you could not use apt, from there. You have to copy unpacked .deb files in a directory located under /mnt/pool and create symlinks.

The way I chooses is the less destructive one.

  1. Store all your stuff under hard disk, somewhere under /mnt/pool/

  2. Create symlinks to bind your stuff to /usr/local/

  3. If you really need to acces /, you have to remount them with mount -o remount,rw /

| improve this answer | |
  • nope, do a full filesystem check first. Remounting rw a filesystem that has been switched read-only by the kernel can only give you more trouble or continue until it has no repair. – Luis Colorado Feb 8 '17 at 9:33
  • Hi! root@ix2:/# fsck -A fsck 1.42.5 (29-Jul-2012) e2fsck 1.42.5 (29-Jul-2012) fsck.ext2: No such file or directory while trying to open /dev/root Possibly non-existent device? – Lorenço Santos Feb 9 '17 at 15:00
  • @LorençoSantos Answer edited. As / is a unionfs, you probably just need to empty the rw partition mounted on / by unionfs – F. Hauri Feb 10 '17 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.