Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

setup script doesn't seem to complete #2

Closed
matt1544 opened this issue Dec 19, 2021 · 11 comments
Closed

setup script doesn't seem to complete #2

matt1544 opened this issue Dec 19, 2021 · 11 comments

Comments

@matt1544
Copy link

Trying this out on my Ubuntu 20.04 machine.

using a new Sandisk USB drive. From the time i enter "/dev/sdb" until the umount message appears at the bottom is about 5 seconds (ie, pretty fast).

Nothing seems to get written to the USB drive.

any pointers or troubleshooting to try?

Installing Dependencies
No Ubuntu version specified, using focal-20.04
ubuntu-rootfs.tar.xz            100%[=====================================================>] 337.25M  25.7MB/s    in 13s     

Which USB Drive or SD Card would you like to use (e.g. /dev/sda)? All data on the drive will be wiped!
sdb              SanDisk_3.2Gen1           usb
/dev/sdb
Ok, using /dev/sdb to install Linux
umount: /dev/sdb: not mounted.
umount: /dev/sdb1: not mounted.
umount: /mnt: not mounted.
umount: /media/*/*: no mount point specified.
Writing storage, may take more than 5 minutes.
Although it seems slow, consider this process like flashing an ISO to a USB Drive.
Below is an innacurate indicator of mB left to write. It may decrease hundreds of megabytes in seconds.

21264+0 records in
21264+0 records out
10887168 bytes (11 MB, 10 MiB) copied, 0.738801 s, 14.7 MB/s
mke2fs 1.45.7 (28-Jan-2021)
Creating filesystem with 30027264 4k blocks and 7512064 inodes
Filesystem UUID: ef2398f2-9d7f-4d99-93a8-f4d06d61a5d0
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (131072 blocks): done
Writing superblocks and filesystem accounting information: done   

Writing storage, may take more than 5 minutes.
Although it seems slow, consider this process like flashing an ISO to a USB Drive.
Below is an innacurate indicator of mB left to write. It may decrease hundreds of megabytes in seconds.

umount: /mnt: not mounted.
umount: /mnt: not mounted.
@MilkyDeveloper
Copy link
Collaborator

MilkyDeveloper commented Dec 19, 2021

Try running the script with bash -x and post the output. Also post the output of ls ~/linux-build.

@ghost
Copy link

ghost commented Dec 19, 2021

I was also having this same issue, here is my output:

ian@PlexServer:$ git clone https://github.com/MilkyDeveloper/cb-linux && cd cb-linux
Cloning into 'cb-linux'...
remote: Enumerating objects: 608, done.
remote: Counting objects: 100% (608/608), done.
remote: Compressing objects: 100% (430/430), done.
remote: Total 608 (delta 343), reused 363 (delta 153), pack-reused 0
Receiving objects: 100% (608/608), 4.21 MiB | 9.10 MiB/s, done.
Resolving deltas: 100% (343/343), done.
ian@PlexServer:
/cb-linux$ bash -x setup.sh gnome

  • source utils/functions.sh

  • source utils/bootstrap.sh

  • source utils/partition.sh

  • source utils/extract.sh

  • [[ -n gnome ]]

  • [[ -n '' ]]

  • printerr 'No distro specified, using Ubuntu'
    ++ tput setaf 196
    ++ tput bold
    ++ tput sgr0

  • echo 'No distro specified, using Ubuntu'
    No distro specified, using Ubuntu

  • set -- gnome ubuntu

  • export DESKTOP=gnome

  • DESKTOP=gnome

  • export DISTRO=ubuntu

  • DISTRO=ubuntu

  • export DISTRO_VERSION=

  • DISTRO_VERSION=
    ++ pwd

  • ORIGINAL_DIR=/home/ian/cb-linux

  • source utils/distros/ubuntu.sh

  • set -e

  • sudo apt install -y toilet
    [sudo] password for ian:
    Reading package lists... Done
    Building dependency tree      
    Reading state information... Done
    toilet is already the newest version (0.3-1.2).
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

  • for i in {1..15}

  • echo

  • for i in {1..15}

  • echo

  • for i in {1..15}

  • echo

  • for i in {1..15}

  • echo

  • for i in {1..15}

  • echo

  • for i in {1..15}

  • echo

  • for i in {1..15}

  • echo

  • for i in {1..15}

  • echo

  • for i in {1..15}

  • echo

  • for i in {1..15}

  • echo

  • for i in {1..15}

  • echo

  • for i in {1..15}

  • echo

  • for i in {1..15}

  • echo

  • for i in {1..15}

  • echo

  • for i in {1..15}

  • echo

  • toilet -f mono12 -F crop Breath
    ▄▄▄▄▄▄                                            ▄▄      
    ██▀▀▀▀██                                  ██      ██      
    ██    ██   ██▄████   ▄████▄    ▄█████▄  ███████   ██▄████▄
    ███████    ██▀      ██▄▄▄▄██   ▀ ▄▄▄██    ██      ██▀   ██
    ██    ██   ██       ██▀▀▀▀▀▀  ▄██▀▀▀██    ██      ██    ██
    ██▄▄▄▄██   ██       ▀██▄▄▄▄█  ██▄▄▄███    ██▄▄▄   ██    ██
    ▀▀▀▀▀▀▀    ▀▀         ▀▀▀▀▀    ▀▀▀▀ ▀▀     ▀▀▀▀   ▀▀    ▀▀

  • toilet -f term -F border 'Made by MilkyDeveloper'
    ┌──────────────────────┐
    │Made by MilkyDeveloper│
    └──────────────────────┘

  • printq 'What would you like your username to be? (no spaces, backslashes, or special characters)'
    ++ tput setaf 114
    ++ tput bold
    ++ tput sgr0

  • echo 'What would you like your username to be? (no spaces, backslashes, or special characters)'
    What would you like your username to be? (no spaces, backslashes, or special characters)

  • read -r BREATH_USER
    istout

  • export BREATH_USER

  • bootstrapFiles

  • mkdir -p /home/ian/linux-build

  • cd /home/ian/linux-build

  • printq 'Installing Dependencies'
    ++ tput setaf 114
    ++ tput bold
    ++ tput sgr0

  • echo 'Installing Dependencies'
    Installing Dependencies

  • sudo apt install -y vboot-kernel-utils arch-install-scripts git wget linux-firmware cgpt
    Reading package lists... Done
    Building dependency tree      
    Reading state information... Done
    arch-install-scripts is already the newest version (23-1).
    cgpt is already the newest version (0R81-12871.B-1).
    vboot-kernel-utils is already the newest version (0
    R81-12871.B-1).
    git is already the newest version (1:2.25.1-1ubuntu3.2).
    linux-firmware is already the newest version (1.187.23).
    wget is already the newest version (1.20.3-1ubuntu2).
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

  • wget https://github.com/MilkyDeveloper/cb-linux/releases/latest/download/bzImage -nc -O bzImage -q --show-progress
    bzImage                         100%[======================================================>]  10.30M  16.7MB/s    in 0.6s    

  • wget https://github.com/MilkyDeveloper/cb-linux/releases/latest/download/modules.tar.xz -nc -O modules.tar.xz -q --show-progress
    modules.tar.xz                  100%[======================================================>]  55.16M  17.4MB/s    in 3.2s    

  • wget https://raw.githubusercontent.com/MilkyDeveloper/cb-linux/main/kernel/kernel.flags -nc -O kernel.flags -q --show-progress
    kernel.flags                    100%[======================================================>]     107  --.-KB/s    in 0s      

  • case $DISTRO in

  • [[ -n '' ]]

  • printerr 'No Ubuntu version specified, using focal-20.04'
    ++ tput setaf 196
    ++ tput bold
    ++ tput sgr0

  • echo 'No Ubuntu version specified, using focal-20.04'
    No Ubuntu version specified, using focal-20.04

  • export DISTRO_VERSION=focal-20.04

  • DISTRO_VERSION=focal-20.04
    ++ echo focal-20.04
    ++ cut -d- -f1

  • export DISTRO_CODENAME=focal

  • DISTRO_CODENAME=focal
    ++ echo focal-20.04
    ++ cut -d- -f2

  • export DISTRO_RELEASE=20.04

  • DISTRO_RELEASE=20.04

  • DISTRO_ROOTFS=ubuntu-rootfs.tar.xz

  • wget http://cloud-images.ubuntu.com/releases/20.04/release/ubuntu-20.04-server-cloudimg-amd64-root.tar.xz -O ubuntu-rootfs.tar.xz -q --show-progress
    ubuntu-rootfs.tar.xz            100%[======================================================>] 337.25M  17.9MB/s    in 20s    

  • futility vbutil_kernel --arch x86_64 --version 1 --keyblock /usr/share/vboot/devkeys/kernel.keyblock --signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk --bootloader kernel.flags --config kernel.flags --vmlinuz bzImage --pack bzImage.signed

  • waitForUSB

  • USBCOUNTER=1

  • true

  • lsblk -o name,model,tran

  • grep -q usb

  • break

  • echo

  • printq 'Which USB Drive or SD Card would you like to use (e.g. /dev/sda)? All data on the drive will be wiped!'
    ++ tput setaf 114
    ++ tput bold
    ++ tput sgr0

  • echo 'Which USB Drive or SD Card would you like to use (e.g. /dev/sda)? All data on the drive will be wiped!'
    Which USB Drive or SD Card would you like to use (e.g. /dev/sda)? All data on the drive will be wiped!

  • lsblk -o name,model,tran

  • grep --color=never usb
    sdd    silicon-power         usb

  • read USB
    /dev/sdd

  • printq 'Ok, using /dev/sdd to install Linux'
    ++ tput setaf 114
    ++ tput bold
    ++ tput sgr0

  • echo 'Ok, using /dev/sdd to install Linux'
    Ok, using /dev/sdd to install Linux

  • unmountUSB

  • sudo umount /dev/sdd /dev/sdd1 /dev/sdd2
    umount: /dev/sdd: not mounted.
    umount: /dev/sdd1: not mounted.

  • sudo umount /mnt
    umount: /mnt: not mounted.

  • sudo umount '/media//'
    umount: /media//: no mount point specified.

  • true

  • partitionUSB

  • sudo parted -s /dev/sdd mklabel gpt

  • syncStorage

  • printq 'Writing storage, may take more than 5 minutes.'
    ++ tput setaf 114
    ++ tput bold
    ++ tput sgr0

  • echo 'Writing storage, may take more than 5 minutes.'
    Writing storage, may take more than 5 minutes.

  • printq 'Although it seems slow, consider this process like flashing an ISO to a USB Drive.'
    ++ tput setaf 114
    ++ tput bold
    ++ tput sgr0

  • echo 'Although it seems slow, consider this process like flashing an ISO to a USB Drive.'
    Although it seems slow, consider this process like flashing an ISO to a USB Drive.

  • printq 'Below is an innacurate indicator of mB left to write. It may decrease hundreds of megabytes in seconds.'
    ++ tput setaf 114
    ++ tput bold
    ++ tput sgr0

  • echo 'Below is an innacurate indicator of mB left to write. It may decrease hundreds of megabytes in seconds.'
    Below is an innacurate indicator of mB left to write. It may decrease hundreds of megabytes in seconds.

  • sync
    ++ grep -e Dirty: /proc/meminfo
    ++ grep --color=never -o '[0-9]+'

  • [[ 95240 -gt 5000 ]]
    ++ grep -e Dirty: /proc/meminfo
    ++ grep --color=never -o '[0-9]+'
    ++ awk '{$1/=1024;printf "%.2fMB\n",$1}'

  • SYNC_MB=78.27MB

  • echo -en '\r78.27MB'
    78.27MB+ sleep 1
    ++ grep -e Dirty: /proc/meminfo
    ++ grep --color=never -o '[0-9]+'

  • [[ 0 -gt 5000 ]]

  • echo

  • sudo parted -s -a optimal /dev/sdd unit mib mkpart Kernel 1 65

  • sudo parted -s -a optimal /dev/sdd unit mib mkpart Root 65 100%

  • sudo cgpt add -i 1 -t kernel -S 1 -T 5 -P 15 /dev/sdd

  • sudo dd if=bzImage.signed of=/dev/sdd1
    21264+0 records in
    21264+0 records out
    10887168 bytes (11 MB, 10 MiB) copied, 1.62391 s, 6.7 MB/s

  • yes

  • sudo mkfs.ext4 /dev/sdd2
    mke2fs 1.45.5 (07-Jan-2020)
    Creating filesystem with 1875456 4k blocks and 469568 inodes
    Filesystem UUID: 977f3f41-5ae8-4e95-bda4-b12cd3250e32
    Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

  • syncStorage

  • printq 'Writing storage, may take more than 5 minutes.'
    ++ tput setaf 114
    ++ tput bold
    ++ tput sgr0

  • echo 'Writing storage, may take more than 5 minutes.'
    Writing storage, may take more than 5 minutes.

  • printq 'Although it seems slow, consider this process like flashing an ISO to a USB Drive.'
    ++ tput setaf 114
    ++ tput bold
    ++ tput sgr0

  • echo 'Although it seems slow, consider this process like flashing an ISO to a USB Drive.'
    Although it seems slow, consider this process like flashing an ISO to a USB Drive.

  • printq 'Below is an innacurate indicator of mB left to write. It may decrease hundreds of megabytes in seconds.'
    ++ tput setaf 114
    ++ tput bold
    ++ tput sgr0

  • echo 'Below is an innacurate indicator of mB left to write. It may decrease hundreds of megabytes in seconds.'
    Below is an innacurate indicator of mB left to write. It may decrease hundreds of megabytes in seconds.

  • sync
    ++ grep -e Dirty: /proc/meminfo
    ++ grep --color=never -o '[0-9]+'

  • [[ 5792 -gt 5000 ]]
    ++ grep -e Dirty: /proc/meminfo
    ++ grep --color=never -o '[0-9]+'
    ++ awk '{$1/=1024;printf "%.2fMB\n",$1}'

  • SYNC_MB=5.51MB

  • echo -en '\r5.51MB'
    5.51MB+ sleep 1
    ++ grep -e Dirty: /proc/meminfo
    ++ grep --color=never -o '[0-9]+'

  • [[ 0 -gt 5000 ]]

  • echo

  • sudo umount /mnt
    umount: /mnt: not mounted.

  • sudo umount -lf /mnt
    umount: /mnt: not mounted.

  • true

  • sudo rm -rf /mnt/Movies /mnt/Vids
    rm: cannot remove '/mnt/Movies': Device or resource busy
    rm: cannot remove '/mnt/Vids': Device or resource busy
    ian@PlexServer:~/cb-linux$ ls /linux-build/
    bzImage  bzImage.signed  kernel.flags  modules.tar.xz  ubuntu-rootfs.tar.xz
    ian@PlexServer:
    /cb-linux$

@MilkyDeveloper
Copy link
Collaborator

@WifiIan I think you have something weird going on in /mnt. It says no storage devices are mounted on /mnt, yet there are files in it. /mnt is supposed to be an empty directory in which you mount storage devices. To fix this on your side, you need remove everything in /mnt.

@matt1544
Copy link
Author

matt1544 commented Dec 19, 2021 via email

@MilkyDeveloper
Copy link
Collaborator

That's what I was thinking too, but the script already unmounted /mnt. This means the files are just dumped in /mnt, which is the completely wrong place to put them.

@ghost
Copy link

ghost commented Dec 19, 2021

Yeah, I would remove that section or find a different way to do this. Anything that happens to be attached here could be wiped out.

For some reason, my Plex server mounted my movie shares to this location and after running this script it dumped my entire movie collection.

MilkyDeveloper added a commit that referenced this issue Dec 20, 2021
@MilkyDeveloper
Copy link
Collaborator

USBs are supposed to be mounted /mnt, so I didn't remove it mounting to /mnt. However, I did make the script exit if any files are found in /mnt.

@mrhappyma
Copy link

I am having a similar issue to this, the rm command claims the mnt directory is empty but the script fails saying it is not...

@MilkyDeveloper
Copy link
Collaborator

MilkyDeveloper commented Feb 28, 2022

Chances are there’s something mounted on it. Google around on how to unmount /mnt.

@mrhappyma
Copy link

Chances are there’s something mounted on it. Google around on how to unmount /mnt.

Nothing I'm finding is working.

@mrhappyma
Copy link

I might have found the issue, there are 2 files "." and ".." in the /mnt directory (and every other directory) that I can't get rid of. Perhaps it is finding those?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants