0

I think I accidentally mounted /dev/hde1 to / after formatting another disk with

 mkdosfs -F 32 -I /dev/hde1

/dev/hdc1 should be mounted on /
but now there is no way to remount it again since /etc/fstab is either readable nor writable, / is empty as the disk /dev/hde1 is.
How do I remount /dev/hdc1 without /etc/

fdisk -l gives only info about /dev/hde (but I already disconnected it) it seems old information umount /dev/hde says it is not mounted after all, possibly nothing is mounted to /

$ cat /proc/partitions
major minor  #blocks  name

  22     0  976554308 hdc
  22     1    2048000 hdc1
  22     2     256000 hdc2
  22     3          1 hdc3
  22     5  974242112 hdc5
  31     0       1024 mtdblock0
  31     1      64496 mtdblock1
  33     0  976554308 hde
  33     1  976551156 hde1
 254     0  974225408 dm-0
   8    16 1953514584 sdb
   8    17 1953512448 sdb1
   8    32  390711384 sdc
   8    33   40161280 sdc1
   8    34  350546332 sdc2


$ mount
rootfs on / type rootfs (rw)
/dev/root on /initrd type ext2 (rw)
tmpfs on /USB type tmpfs (rw)
/dev/hdc1 on / type ext3 (ro,data=journal)
proc on /proc type proc (rw)
devpts on /dev/pts type devpts (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /ramfs type ramfs (rw)
/dev/c/c on /c type ext3 (rw,noatime,data=ordered,usrquota,grpquota)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda2 on /USB/USB_HDD_1 type ext3 (ro,noatime,data=journal)

is how it should be, but also old information

I tried:

$ mount /dev/hdc1 / -t ext3
can't create lock file /etc/mtab~2509: No such file or directory (use -n flag to override)

$ mount /dev/hdc1 / -t ext3 -n
mount: /dev/hdc1 is not a block device, and stat fails?

It is a closed system (readynas) and stores all my pictures these are still accessible, but I cannot mount new external disks to copy the pictures to, although dmesg sees the disk, I cannot mount it the normal way either

2 Answers 2

0

Have you tried rebooting it? Since you didn't edit the /etc/fstab file, it should reset the mount points automatically when it reboots. Optionally, you can also try umount /dev/hde1 to remove just that one mount.

7
  • the stuff on it is so precious that since i still have ssh contact (i cannot gain new access either way) that i dare not to reboot, as i don't know if it will boot again and i am locked out. umount does say it isn't mounted Commented May 27, 2015 at 23:34
  • Did you edit the /etc/fstab file? If not, reboot and get access to the normal / partition Commented May 27, 2015 at 23:36
  • i didn't manually, don't you think i could have screwed up the partition table, which i can not access anymore once rebooted? Commented May 27, 2015 at 23:45
  • the disk is not easy to attach to another system to retrieve the data, thats why i don't dare to screw up more as i still have access now Commented May 27, 2015 at 23:48
  • Fstab has nothing to do with the partition table Commented May 27, 2015 at 23:52
0

Perhaps:

  • Create a new directory in an existing directory you can still access.
  • mount this new directory to /dev/hdc1.

Presumably the full / tree, including /etc, should then be accessible through the ad hoc mountpoint.

  • Check /etc/fstab for correctness, editing it to be correct if it's not.
  • Reboot.
3
  • it doesn't work: $ mount /dev/hdc1 disk/ -t ext3 -n mount: /dev/hdc1 is not a block device, and stat fails? Commented May 28, 2015 at 0:01
  • @nielswebwerk Oohf, of course -- unmounting / means /dev isn't accessible for the OS to find. What about rebooting to a LiveCD / LiveUSB to inspect /etc/fstab? It's looking like taking the reboot plunge, one way or the other, may be the only option.
    – hBy2Py
    Commented May 28, 2015 at 3:04
  • This is confusing.  If / has been hidden by having something mounted over it, /bin and /proc shouldn't be accessible, either, and yet cat /proc/partitions worked. Commented Jun 12, 2015 at 5:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .