Results 1 to 3 of 3

Thread: Cannot delete snapshot - read only filesystem

  1. #1

    Default Cannot delete snapshot - read only filesystem

    Hi, i was preparing my Leap 15.0 opensuse distribution for upgrade to 15.1 release.
    So i cleaned the space on root file system using the snapper delete command.

    Now "snapper list" reports

    linux-2wjj:/.snapshots # snapper list
    Type | # | Pre # | Date | User | Cleanup | Description | Userdata
    -------+---+-------+--------------------------+------+---------+-----------------------+---------
    single | 0 | | | root | | current |
    single | 1 | | Fri Jan 29 19:28:27 2016 | root | | first root filesystem |


    However if i go into the /.snapshots directory i found a snapshot directory "425" that is not listed in snapper list output :

    linux-2wjj:/.snapshots # ls -l
    total 4
    drwxr-xr-x 1 root root 32 Jan 29 2016 1
    drwxr-xr-x 1 root root 16 Sep 21 13:37 425
    -rw-r----- 1 root root 184 Sep 21 01:32 grub-snapshot.cfg
    linux-2wjj:/.snapshots #


    I am unable to clean the 425 using "rm -rf 425" snapshot because the system reports to be "read-only"
    but this is not the case because the /proc/mounts does not shows any read only mount point.

    linux-2wjj:/.snapshots/425 # cat /proc/mounts
    sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
    proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
    devtmpfs /dev devtmpfs rw,nosuid,size=1988544k,nr_inodes=497136,mode=755 0 0
    securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
    tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
    devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
    tmpfs /run tmpfs rw,nosuid,nodev,mode=755 0 0
    tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0
    cgroup /sys/fs/cgroup/unified cgroup2 rw,nosuid,nodev,noexec,relatime 0 0
    cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,name=systemd 0 0
    pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
    cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0
    cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
    cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
    cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0
    cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0
    cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
    cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0
    cgroup /sys/fs/cgroup/rdma cgroup rw,nosuid,nodev,noexec,relatime,rdma 0 0
    cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
    cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
    cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
    /dev/sda2 / btrfs rw,relatime,space_cache,subvolid=259,subvol=/@/.snapshots/1/snapshot 0 0
    systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=32,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13214 0 0
    debugfs /sys/kernel/debug debugfs rw,relatime 0 0
    mqueue /dev/mqueue mqueue rw,relatime 0 0
    hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0
    /dev/sda2 /var/opt btrfs rw,relatime,space_cache,subvolid=274,subvol=/@/var/opt 0 0
    /dev/sda2 /opt btrfs rw,relatime,space_cache,subvolid=262,subvol=/@/opt 0 0
    /dev/sda2 /srv btrfs rw,relatime,space_cache,subvolid=263,subvol=/@/srv 0 0
    /dev/sda2 /var/lib/mariadb btrfs rw,relatime,space_cache,subvolid=269,subvol=/@/var/lib/mariadb 0 0
    /dev/sda2 /var/tmp btrfs rw,relatime,space_cache,subvolid=276,subvol=/@/var/tmp 0 0
    /dev/sda2 /boot/grub2/x86_64-efi btrfs rw,relatime,space_cache,subvolid=261,subvol=/@/boot/grub2/x86_64-efi 0 0
    /dev/sda2 /var/lib/mailman btrfs rw,relatime,space_cache,subvolid=268,subvol=/@/var/lib/mailman 0 0
    /dev/sda2 /var/lib/named btrfs rw,relatime,space_cache,subvolid=271,subvol=/@/var/lib/named 0 0
    /dev/sda2 /var/spool btrfs rw,relatime,space_cache,subvolid=275,subvol=/@/var/spool 0 0
    /dev/sda2 /var/log btrfs rw,relatime,space_cache,subvolid=273,subvol=/@/var/log 0 0
    /dev/sda2 /var/lib/mysql btrfs rw,relatime,space_cache,subvolid=270,subvol=/@/var/lib/mysql 0 0
    /dev/sda2 /var/lib/pgsql btrfs rw,relatime,space_cache,subvolid=272,subvol=/@/var/lib/pgsql 0 0
    /dev/sda2 /tmp btrfs rw,relatime,space_cache,subvolid=264,subvol=/@/tmp 0 0
    /dev/sda2 /var/crash btrfs rw,relatime,space_cache,subvolid=266,subvol=/@/var/crash 0 0
    /dev/sda2 /var/lib/machines btrfs rw,relatime,space_cache,subvolid=533,subvol=/@/var/lib/machines 0 0
    /dev/sda2 /.snapshots btrfs rw,relatime,space_cache,subvolid=258,subvol=/@/.snapshots 0 0
    /dev/sda2 /usr/local btrfs rw,relatime,space_cache,subvolid=265,subvol=/@/usr/local 0 0
    /dev/sda2 /boot/grub2/i386-pc btrfs rw,relatime,space_cache,subvolid=260,subvol=/@/boot/grub2/i386-pc 0 0
    /dev/sda2 /var/lib/libvirt/images btrfs rw,relatime,space_cache,subvolid=267,subvol=/@/var/lib/libvirt/images 0 0
    /dev/sda3 /home xfs rw,relatime,attr2,inode64,noquota 0 0
    binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
    Downloads /media/sf_Downloads vboxsf rw,nodev,relatime,iocharset=utf8,uid=0,gid=479,dmode=0770,fmode=0770,tag=VBoxAutomounter 0 0
    tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=399352k,mode=700,uid=1000,gid=100 0 0
    tracefs /sys/kernel/debug/tracing tracefs rw,relatime 0 0
    gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=100 0 0
    fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
    linux-2wjj:/.snapshots/425 #


    I also checked the file system for errors but found any

    linux-2wjj:~ # btrfs check --force /dev/sda2
    WARNING: filesystem mounted, continuing because of --force
    Checking filesystem on /dev/sda2
    UUID: a8c4e732-824a-4e49-a599-7cfc3c561adc
    checking extents
    checking free space cache
    checking fs roots
    checking csums
    checking root refs
    found 53646729216 bytes used, no error found
    total csum bytes: 50354064
    total tree bytes: 1114816512
    total fs tree bytes: 999653376
    total extent tree bytes: 53526528
    btree space waste bytes: 183687393
    file data blocks allocated: 128831205376
    referenced 72687431680
    linux-2wjj:~ #


    I need help ... Any hint to delete 425 snapshot directory ?
    Tnx, Fabio,

  2. #2
    Join Date
    Sep 2012
    Posts
    5,126

    Default Re: Cannot delete snapshot - read only filesystem

    Quote Originally Posted by fcapozzi View Post
    I am unable to clean the 425 using "rm -rf 425" snapshot because the system reports to be "read-only"
    but this is not the case
    It is. Snapshot is read-only by definition, "rm -r" attempts to recursively delete its content and fails as it should.
    Any hint to delete 425 snapshot directory ?
    Code:
    btrfs subvolume delete /.snapshots/425/snapshot
    rm -rf /.snapshots/425

  3. #3

    Default Re: Cannot delete snapshot - read only filesystem

    Tnx, Problem is solved. I deleted the 425 snapshot and now i'm going to upgrade.
    Greetings. Fabio.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •