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?

3
  • 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.
    – user253751
    May 29, 2016 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, 2016 at 14:38
  • @Archemar haha, great metaphor May 29, 2016 at 14:57

1 Answer 1

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.

6
  • is this a bug ? this issue related for kernel or mount command?
    – HP_perfect
    May 29, 2016 at 5:45
  • 17
    It is not a bug but a system administrator error (yours). Using a root account implies responsibility for knowing what you're doing. May 29, 2016 at 5:59
  • 1
    @Julie So mounting back /proc and /sys after 'moving' / can prevent a freeze?
    – nl-x
    May 29, 2016 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). May 29, 2016 at 11:29
  • 5
    @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, 2016 at 11:42

You must log in to answer this question.

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