M
M
masterdrew2016-05-06 15:21:32
linux
masterdrew, 2016-05-06 15:21:32

Will the command rm -rf / remove the contents of external hard drives?

There is such a terrible command that deletes all system files: rm -rf /
I know from my own experience that in addition to the contents of the hard disk, all the contents of inserted flash drives, sd cards, etc. are also deleted.
Actually the question is whether this command will delete the contents of:
1. hard drives connected via usb
2. network drives or partitions connected via local network

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Anatoly Evladov, 2016-05-06
@Visteras

Delete if they are mounted, i.e. if the data is located somewhere at /something-there, it will naturally delete it.
Unless, of course, you have the right to do so.

F
Fixid, 2016-05-06
@Fixid

1. Only if they are mounted
2. Only if they are mounted as local folders (smb will not affect)
In reality, there has long been a patch that protects against rm -rf /

V
Vladimir Kuts, 2016-05-06
@fox_12

Delete ... I remember on Radio-T I listened to an instructive story how one pr thus erased client data along with backups, because during the execution of the command, volumes with backups were also mounted on the system.
By the way, this is an instructive story

E
Ergil Osin, 2016-05-07
@Ernillew

No, it won't delete. It won't delete anything at all.
rm: it is dangerous to operate recursively on '/'
rm: use --no-preserve-root to override this failsafe

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question