2

I have a partition /dev/sdb1 what happens after executing this command?

sudo mount /dev/sdb1 / -o rw
                     ^       

I know that must change mountpoint "/" address as mentioned above. When I type this in my terminal. The command is executed but after some minutes my laptop will freeze. i want to know what happens?

  • 1
    What do you think happens? The same thing happens as if you run sudo mount /dev/sdb1 /mnt -o rw, except it mounts it at / instead of /mnt. – user20574 May 29 '16 at 9:27
  • 2
    I assume / is not ro on sdb1, but rw on sda1, So this basically tell linux "hold to the brush (while painting roof ``), I change the ladder (from sda1 to sdb1)". – Archemar May 29 '16 at 14:38
  • @Archemar haha, great metaphor – underscore_d May 29 '16 at 14:57
8

I would have hoped for an error message but since it freezes, it apparently mounts it as requested, making the whole system lose reference to its resource mounts (/proc and /sys), its library references, any other mounts, and possibly other stuff.

Let this be a lesson as one of many things that you should never run. At least it gets solved by a reboot.

  • is this a bug ? this issue related for kernel or mount command? – HP_perfect May 29 '16 at 5:45
  • 16
    It is not a bug but a system administrator error (yours). Using a root account implies responsibility for knowing what you're doing. – Julie Pelletier May 29 '16 at 5:59
  • 1
    @Julie So mounting back /proc and /sys after 'moving' / can prevent a freeze? – nl-x May 29 '16 at 10:18
  • 1
    @nl-x: Yes, if done quickly and carefully enough. That's what boot sequences do if they need to remount / along the way (e.g. booting with a ramdisk as / at first in order to load enough kernel modules to get the actual root device to work). – Henning Makholm May 29 '16 at 11:29
  • 4
    @hassanpanahi Linux doesn't prevent you from shooting in the foot, it presumes that if you are doing something is because you are competent enough to know how to fix it in case something goes wrong. So it's not a bug. – Braiam May 29 '16 at 11:42

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.