MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Everything was going so well

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    52 Posts 4 Posters 21.8k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      JMac
      last edited by

      so I run the command sudo umount /dev/sda
      and get
      umount: /dev/sda: not mounted.

      so should now go,
      e2fsck -f -v /dev/sda
      not the original
      e2fsck -f -v mmcblk0p2

      ?

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @JMac
        last edited by

        @JMac correct… you had to find the disk name

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          JMac @sdetweil
          last edited by

          @sdetweil when i run e2fsck…
          I get
          e2fsck: permission denied while trying to open /dev/sda
          you must have r/w access to the filesystem or be root.

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @JMac
            last edited by sdetweil

            @JMac yes, you must use sudo on both commands unmount and fsck

            sorry I was unclear

            normal users should not be able to mess with hardware, so one must act as root

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            J 1 Reply Last reply Reply Quote 0
            • J Offline
              JMac @sdetweil
              last edited by

              @sdetweil I run sudo umount…
              and get
              umount:… not mounted,

              then run
              sudo e2fsck -f -v /dev/sda
              and get
              e2fsck 1.46.2 (28-feb-2021)
              /dev/sda is in use
              efsck: connot continue, aborting.

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                sdetweil @JMac
                last edited by

                @JMac hm… wonder what is using it?

                can you open the disks app on the pi from the dedktop menu

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                J 1 Reply Last reply Reply Quote 0
                • J Offline
                  JMac @sdetweil
                  last edited by

                  @sdetweil on the home screen I have 2 drive icons under the wastebasket.
                  one is boot
                  the other is rootfs

                  i then have the option to eject these in the file manager

                  S 1 Reply Last reply Reply Quote 0
                  • S Offline
                    sdetweil @JMac
                    last edited by

                    @JMac there should be that drive on /dev/sda too

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    J 1 Reply Last reply Reply Quote 0
                    • J Offline
                      JMac @sdetweil
                      last edited by

                      @sdetweil I’m a little confused (I’d imagine thats pretty clear at this point).

                      i run sudo fdisk -1
                      and get
                      Disk /dev/ram0 through to Disk /dev/ram15
                      the list then has
                      Disk/dev/mmcblk0: 7.4GiB (my thinking is this is the current/new sd card)

                      Device
                      /dev/mmcblk0p1
                      /dev/mmcblk0p2

                      Disk /dev/sda:59.69 GiB (I again assume this is the old SD with my original MM setup)

                      Device
                      /dev/sda1
                      /dev/sda/2

                      end of the list.

                      does any of that make sense/ is any of it what I’m looking for? I’ve obviously taken out several lines under each of those headers just for space and time typing.

                      S 1 Reply Last reply Reply Quote 0
                      • S Offline
                        sdetweil @JMac
                        last edited by

                        @JMac yes sda has two partitions boot and rootfs

                        but you need to run e2fsck on /dev/sda2
                        e2fsck mean extended version 2, file system check

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        1 Reply Last reply Reply Quote 0
                        • J Offline
                          JMac
                          last edited by

                          so should i also run sudo umount /dev/sda2 before running sudo e2fsck -f -v /dev/sda2?

                          S 1 Reply Last reply Reply Quote 0
                          • S Offline
                            sdetweil @JMac
                            last edited by

                            @JMac yes

                            Sam

                            How to add modules

                            learning how to use browser developers window for css changes

                            J 1 Reply Last reply Reply Quote 0
                            • J Offline
                              JMac @sdetweil
                              last edited by

                              @sdetweil so I’ve run sudo umount /dev/sda1 and the same for sda2 and both folders have disappeared off the home screen.

                              which e2fsck do I run if i had to unmount 2 drives?

                              S 1 Reply Last reply Reply Quote 0
                              • S Offline
                                sdetweil @JMac
                                last edited by

                                @JMac unmount means remove them from normal file system access

                                the device names still exist

                                as e2fsck could modify the file system blocks on the drive, you don’t want to do that while you could still copy a file there

                                so you are passing the hardware name to e2fsck

                                Sam

                                How to add modules

                                learning how to use browser developers window for css changes

                                J 1 Reply Last reply Reply Quote 0
                                • J Offline
                                  JMac @sdetweil
                                  last edited by

                                  @sdetweil so do I run e2fsck -f -v /dev/sda1 or e2fsck -f -v /dev/sda2
                                  or does it not matter?

                                  I’m struggling here to the bigger picture so can’t see the logic of the steps.

                                  S 1 Reply Last reply Reply Quote 0
                                  • S Offline
                                    sdetweil @JMac
                                    last edited by

                                    @JMac ok bigger picture, in Linux

                                    hardware devices are named. see the output of ls /dev

                                    disk devices are usually named sd??? where xxx is a letter, and partition number
                                    letter a is the first device b the second etc

                                    sometime in the past the type of storage device was also used as part of the name, scsi, atapi …
                                    for this case they are named sd (storage device)

                                    sda is the first storage device
                                    sda1 is the first partition on the sda device

                                    on those partitions are a logical way of storing data. most linux and all windows devices store file data in sectors, 512 byte chunks called sectors. and then the file system (way of organizing those sectors)
                                    applies some data structure on top. it’s a directory or a file. tables in other sectors build trees of data to describe the entire partition.

                                    there are different layouts depending on vendor and intended use
                                    FAT, exFAT, NTFS EXT3, EXT4, and a host of others.

                                    all is wonderful until some sector or more gets damaged… machine was powered off during write, a hardware failure…

                                    now the filesystem code is confused… says read sector 853, and the bits there will tell it where the next sector is for this file. but the bits don’t point to the right place… Oops

                                    some file systems include a duplicate set of bits do there is an alternative way . some use them only for recovery.

                                    sd card hardware is known for being fragile. it was designed for lots of reads,with few writes. camera picture music file. NOT an os that is waiting logs and other stuff constantly.

                                    anyhow.
                                    to check and correct these kinds of problems with the Linux ext file system we need to run thr fsck program on the raw partition. and make sure that moone else is using it.

                                    unmount takes it out of circulation. no users files open

                                    fsck and e2fsck need to read the raw sectors on the partition, but we just unmounted it.
                                    so we need to provide the hardware name for the program to use.

                                    Sam

                                    How to add modules

                                    learning how to use browser developers window for css changes

                                    J 1 Reply Last reply Reply Quote 0
                                    • J Offline
                                      JMac @sdetweil
                                      last edited by

                                      @sdetweil Wow, that was a bit to take in but makes sense (I think).

                                      So if I unmount it how do I get the information off it?
                                      what are the steps here?

                                      S 1 Reply Last reply Reply Quote 0
                                      • S Offline
                                        sdetweil @JMac
                                        last edited by sdetweil

                                        @JMac
                                        unmount it
                                        run fsck against it
                                        remount it (hopefully fixed)

                                        then copy your data first thing, DO NOT WRITE TO THE SD CARD

                                        config.js
                                        custom.css
                                        and a list of all the modules in modules (ls *)

                                        if u WANT to try in each module folder do

                                        git remote -v
                                        ```⁷
                                        so we know where it came from
                                        
                                        quickest way in each module folder
                                        
                                        git remote -v | tail -a ~/module_list 
                                        
                                        this will list to github source (git remote -v) and append that info  (tail -a) to a known file in your home folder (~ = home)
                                        
                                        this is what my backup script does
                                        IF you have any modules that require authentication (run an auth script) 
                                        ls *.json while you are there,
                                        
                                        you could also run my backup script, from the web page copy/paste  with -s  pointing to the mounted folder MagicMirror 
                                        https://github.com/sdetweil/MagicMirror-backup-restore
                                        
                                        ...MM_backup -s /media/??????/MagicMirror some gobbleygoop name (tab key will fill it in after the 1st letter)
                                        
                                        this will create the MM_backup folder in your logged on user home folder..  
                                        and do all the work described above (after the mount)
                                        https://github.com/sdetweil/MagicMirror-backup-restore

                                        Sam

                                        How to add modules

                                        learning how to use browser developers window for css changes

                                        1 Reply Last reply Reply Quote 0
                                        • J Offline
                                          JMac
                                          last edited by

                                          had a little crack at this again, the Mrs is bugging me to get “her” mirror back up and running.

                                          So I’ve run sudo umount /dev/sda1
                                          sudo umount /dev/sda2

                                          Both drive folders from the mounted (old) SD disappeared from the home screen on the pi as expected.

                                          then run, (and got)
                                          sudo e2fsck -f -v /dev/sda2
                                          e2fsck 1.46.2 (28-feb-2021)
                                          rootfs: recovering journal
                                          superblock needs_recovery flag is clear but journal has data.
                                          Run journal anyway ? YES
                                          e2fsck: unable to set superblock flags on rootfs

                                          rootfs: *********** WARNING: filesytem still has errors *********

                                          S 1 Reply Last reply Reply Quote 0
                                          • S Offline
                                            sdetweil @JMac
                                            last edited by

                                            @JMac bummer

                                            from search
                                            https://unix.stackexchange.com/questions/327863/fsck-wont-fsck-unable-to-set-superblock-flags/386886#386886

                                            was the card readable at all? if so
                                            take it out and put it back in to get mounted
                                            and copy the old config.js, custom.css and do

                                            ls >~/savedlist.txt

                                            in the MagicMirror/modules folder
                                            to some file on your booted card

                                            then we can help you rebuild a new sd card

                                            Sam

                                            How to add modules

                                            learning how to use browser developers window for css changes

                                            J 2 Replies Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 1 / 3
                                            • First post
                                              Last post
                                            Enjoying MagicMirror? Please consider a donation!
                                            MagicMirror created by Michael Teeuw.
                                            Forum managed by Sam, technical setup by Karsten.
                                            This forum is using NodeBB as its core | Contributors
                                            Contact | Privacy Policy