[clamav-users] How to scan a single partition

Sorin Petrut Niculae sniculae at gmv.com
Mon Apr 26 13:28:05 UTC 2021


Hello,

You can use the --exclude-dir= option and indicate what you want to exclude from the scan process.

Regards.

Sorin Petrut Niculae
[cid:image009.jpg at 01D4C7AC.7C1B4010]
P Please consider the environment before printing this e-mail.

De: clamav-users [mailto:clamav-users-bounces at lists.clamav.net] En nombre de Christian
Enviado el: lunes, 26 de abril de 2021 15:15
Para: clamav-users at lists.clamav.net
Asunto: [clamav-users] How to scan a single partition

Hi altogether,

My system is Linux/Lubuntu 20.04.2 LTS, 64 bit.

I have three partitions: root-, home- and a third (data-)partition with 23 GB, 36 GB and 193 GB respectively plus 3 usb-sticks:

df -h
Dateisystem    Größe Benutzt Verf. Verw% Eingehängt auf
udev            1,9G       0  1,9G    0% /dev
tmpfs           386M    1,8M  384M    1% /run
/dev/sdc1        23G     13G  9,4G   58% /                                                                                               # root partition
tmpfs           1,9G       0  1,9G    0% /dev/shm
tmpfs           5,0M    8,0K  5,0M    1% /run/lock
tmpfs           1,9G       0  1,9G    0% /sys/fs/cgroup
/dev/sdc2        36G     22G   12G   64% /home                                                                                      # home partition
tmpfs           386M     12K  386M    1% /run/user/1000
/dev/sdf1       7,5G    2,1G  5,4G   29% /media/rosika/A492-CD29                                                      # usb-stick 1
/dev/sdd1        30G     26G  4,1G   87% /media/rosika/28BC-DAFC                                                    # usb-stick 2
/dev/sdc3       193G     99G   84G   55% /media/rosika/f14a27c2-0b49-4607-94ea-2e56bbf76fe1      # 3rd partition (data-partition)
/dev/sdb         30G     26G  3,9G   87% /media/rosika/74C1-30C7                                                       # usb-stick 3


What I want to do is: scan the root-partition exclusively, not the other ones and not the sticks.

What command would I need for this?

Looking around on the web I found this command (https://pikedom.com/clam-anti-virus-on-arch-linux/<https://urldefense.com/v3/__https:/pikedom.com/clam-anti-virus-on-arch-linux/__;!!MvyJQugb!UTh6PNfhWdejMB2D2RnSbIP71nosYbh3kI0IwKzHttlCCE8FeJ1WQN7iSW3K$> ):

clamscan --recursive --infected --exclude-dir='^/sys|^/dev|^/proc|^/var/lib/clamav' --max-filesize=4000M --max-scansize=4000M / -l ~/clamav-scan-results/201803261436

As the starting point is / this would scan everything, right? Which is not what I want to achieve.

Thanks for your help in advance.

Many greetings.
Rosika

P Please consider the environment before printing this e-mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clamav.net/pipermail/clamav-users/attachments/20210426/0ad0aef9/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 27993 bytes
Desc: image001.jpg
URL: <https://lists.clamav.net/pipermail/clamav-users/attachments/20210426/0ad0aef9/attachment.jpg>


More information about the clamav-users mailing list