1

When mounting the drive /dev/sda1 (mount -o remount,rw /dev/sda1 -t ext4 /mnt)from a rescue cd, I get mount: /mnt not mounted already, or bad option. I don't know what to do here because I've searched forums for hours and no-one had a fix that worked. I need this solution because i'm using it to chroot into an old machine with some files on it and a password I need to recover.

orbitwar
  • 11
  • 1
  • 1
  • 5
  • Please type mount and paste its output. – Marco Aug 16 '17 at 17:03
  • Is `sda1` mounted already? To check it use command: `mount | grep sda1`. – Mikhail Khirgiy Aug 16 '17 at 17:53
  • The error message tells you all you need to know: /mnt is not already mounted, so the "remount" part of your mount command is wrong, there's nothing to REmount. – wurtel Aug 17 '17 at 09:13
  • @Marco tmpfs on /dev/shm type tmpfs (Rw,mode=1777) Proc on /proc type proc (rw) Sysfs on /sys type sysfs (rw) Debugfs on /sys/kernel/debug type debugfs (rw) Udev on /dev type tmpfs (rw,mode=0755) devpts on /dev/pts type devpts (rw,mode=0620,gid=5 each 4-space gap represents a line break. I was writing this on a phone so the enter button was send, sorry. – orbitwar Aug 17 '17 at 15:07
  • @MikhailKhirgiy There was no response, no error code or confirmation. – orbitwar Aug 17 '17 at 15:08
  • @orbitwar Then *MatarangeCa* is right! – Mikhail Khirgiy Aug 17 '17 at 15:14
  • @wurtel Ok, I tried the command without ‘remount,’ and ‘-t ext4’ and even specifying ‘-o rw’ didn’t work and it returned `mount: warning: /mount seems to be mounted read-only`. :( the whole command was `mount -o rw /dev/sda1 /mnt` – orbitwar Aug 17 '17 at 15:14
  • Well, according to your pasted output, I actually agree with the response below, -o remount shouldn't be there. Have you tried the same command without this option? It should give you no output and successfully mount sda1. Then try mount |grep sda1 again. It should show the mounted partition. – Marco Aug 17 '17 at 15:15
  • @Marco I did the command he (and @wurtel )said, `mount -o rw /dev/sda1 /mnt` and it returned `mount: warning: /mnt seems to be mounted read-only` I honestly thought his answer would work. – orbitwar Aug 17 '17 at 15:20
  • Then you pasted wrong (!!!) or at least partial mount output. umount /mnt. If you get an error, umount -f /mnt. Then follow answer's suggestions. – Marco Aug 17 '17 at 15:22
  • @Marco Ok, while you were responding, I was checking the command 3 times then unmounting and mounting again to no avail. I ran the umount twice to confirm, now it’s unmounted. Now I run the command he sent and same thing. Read only. I’ll even retype it instead of using up arrow and read only again, sigh – orbitwar Aug 17 '17 at 15:26
  • Mount it elsewhere. mkdir /ciao . mount /dev/sda1 /ciao. You must be root to do this. – Marco Aug 17 '17 at 15:27
  • @Marco hmm, `mount: warning: ciao seems to be mounted read-only` I will be back in about an hour, sorry for the inconvenience – orbitwar Aug 17 '17 at 15:31
  • It lets you create a folder, but you can't mount anything rw into it. Try mount -o ro /dev/sda1 /ciao . – Marco Aug 17 '17 at 15:32
  • And change the live distro you're using for this, it's c**p, switch to debian live, ubuntu or knoppix. – Marco Aug 17 '17 at 15:34
  • @Marco I ran the command with -o ro instead and there was no error but when I tried to do mkdir it was read only, so that didn’t work. I switched live OS from suse (matching the os on the system) to Ubuntu and tried the command. There was no error or anything and it mounted but when I test rw capabilities by doing `cd /mnt && Sudo mkdir test` , it says `mkdir: cannot create directory @testA: read-only filesystem` – orbitwar Aug 17 '17 at 17:50
  • What if you mount rw instead of ro? – Marco Aug 17 '17 at 17:56
  • @Marco same error as last time, I can’t do mkdir – orbitwar Aug 17 '17 at 17:58
  • I think filesystem on `sda1` is corrupted or not successfully unmounted (by power off). Unmount it and test it by command `e2fsck -vf /dev/sda1`. – Mikhail Khirgiy Aug 18 '17 at 19:44
  • Also show to us the output of command `cat /proc/mdstat`. – Mikhail Khirgiy Aug 18 '17 at 19:51
  • This sounds disappointing as I’ve had superblock problems before. I ran the e2fsck command and there were multiple lines of outputs. I will just put a simplified version of each. `Bad magic number in super block,` `super block invalid`, and `the super block can not be read or doesn’t have a correct ext2 file system`. So that much be the root of the problem. Now I assume the drive is unusable but this make me curious because the os still boots up. Anyway, the other command you gave me doesn’t work. I switched to knoppix because Ubuntu live wasn’t working so that might be the issue. – orbitwar Aug 18 '17 at 23:56
  • THe comment was too long, and the result of that command was : `cat: /proc/ is a directory` and `cat: mdstat: no such file or directory.` – orbitwar Aug 18 '17 at 23:57
  • Also, in Gparted the file system is unknown. This is probably why it’s read-only. Even the system mounted it automatically and I couldn’t write to it. I think we’ve solved it but I’m not completely sure, so I’m open to responses :) – orbitwar Aug 19 '17 at 00:02
  • If it’s not possible to write, should I clone the drive (only 1GB) to an sd card, then do a Chroot? I would have to get the mbr and everything, though. Something I’ve never done successfully – orbitwar Aug 19 '17 at 00:05
  • I recommend you to use SystemResqueCD and testdisk program to try to rescue filesystem. Do full backup or disk duplication before all. – Mikhail Khirgiy Aug 19 '17 at 03:55
  • Ok, I got the disc and booted to it then did test disk but dumb me forgot to backup before doing so... it did the partition repair and it turned two partitions into one and now it has rw capabilities (yay?). I couldn’t chroot into it though, no bin/bash and there was no home folder – orbitwar Aug 23 '17 at 03:20
  • Now I think it’s a lost cause because the hard drive is screwed up, and I don’t know if it can still boot. I’ll check tomorrow afternoon for that though – orbitwar Aug 23 '17 at 03:21
  • The os doesn't work anymore, it just goes to a grub prompt. I'll just install a new os... Oh well. It was a good try though and great effort, thanks for the help everybody! Sorry to let you down with this new though – orbitwar Aug 24 '17 at 23:16
  • remove `remount` word and works fine. – e-info128 Jul 01 '23 at 07:41

2 Answers2

2

It's simpler than you think. You can find docs of mount in man page of mount command.

man mount

There is a way to do search inside man page but this is another subject.

Mount's man pages specifies that remount option is used to attempt to remount an already-mounted filesystem. So you should only use that option if the filesystem is already mounted.

Also, in most cases, you don't need to specify filesystem type. It should be automatically detected unless the partition table is damaged.

That should work:

mount -o rw /dev/sda1 /mnt

Also please note that you can create folders in /mnt when nothing yet is mounted in order to have mount points for multiple devices/partitions.

Just mkdir /mnt/sda1 and mount sda1 in there, not in the /mnt root.

Marco
  • 1,709
  • 3
  • 17
  • 31
1

If there is a wrong option in fstab which keeps the filesystem in read-only after reboot, this had helped for me to make it rw:

mount /dev/md127 / -o remount,rw

(adjust /dev/md127 to any block device as needed)

per idea from https://bugzilla.redhat.com/show_bug.cgi?id=573548

Roman Spiak
  • 583
  • 3
  • 11
stAn
  • 11
  • 1