You are not logged in.

#1 2022-02-07 19:16:11

Lizzy_Mae
Member
From: Lafayette, IN
Registered: 2022-02-07
Posts: 6

[SOLVED] umount file not deleting

Hello all,

First time here, be gentle.

I am a full-time student with a full-time job and definitely full-time no life. I have been using Arch for 6 months, plasma desktop or most say kde, I only have the plasma-sdk which is the developer add-ons like QT, don't use dolphin, gwenview, or any of kde programs, no pamac, just yay. Will eventually land on Qtile or Awesome, something to keep learning code.

I am trying to learn chroot. Good to have if something fails, and boy did it, me trying to learn how. I simply broke something on purpose to see if I could fix it. Don't worry, it wasn't deleting /etc or anything like that. I read Chroot   Troubleshooting   arch-chroot.8   Basic Chroot. Evenually I would like to create a clean chroot for personal projects, not for the repositories.

Used same ISO as the install, I took notes as you can see. All I can do until I learn how these Services work.


mkdir /fix  (yes arch iso /mnt also works)

mount -t proc /proc proc/  /fix
mount -t sysfs /sys sys/   /fix
mount --rbind /dev dev/    /fix
another chroot tutorial said to also add run, tmp

ls- /fix   dev, proc, run, sys, tmp, @, @home  (btrfs)

mount /dev/sdd3 /fix  (ssd3 root and home, I symlink for personal files to second drive, sdd1 efi, ssd2 swap)

ERRORS came and came... whatever I tried...
chroot /fix /bin/bash (no such file)
...is not a mountpoint
...failed to run command /bin/bash, no such directory


Then my battery died on laptop, grabbed charger plugged back in. Wasn't getting anywhere so I went looking for answers.

Found the answer I hope to problem below:
Partition TYPE (fat, ext2, ext3, etc)  needs to be used from blkid (or fstab), with the :mount -TYPE /dev/ssd3 /fix

Went back in, started over, but I was curious if everything was still mounted after battery died.

/Fix directory was gone, used iso /mnt and everything was still there.

mount /dev/ssd3 /mnt
ls- dev, proc, run, sys, tmp, @, @home

Created the /fix directory and mounted back in, all still there ( I know why not use mnt you was just there)

mkdir /fix
  mount /dev/ssd3 /fix
  ls- dev, proc, run, sys, tmp, @, @home
 
 
PROBLEM:
Tried umount and umount -R /fix  and all directories still there, tried individually, all said not mounted. Because battery died and didn't unmount, I don't know.

Can't just rm -r, they are live system files. Only @ and @home should remain after umount.

I DID NOT try tutorial yet on laptop, and didn't know if I was allowed to post the chroot tutorial I'll be using after mess is cleaned up.

Any help will be appreciated dearly.

Lizzy Mae

Last edited by Lizzy_Mae (2022-02-24 05:41:37)


Exercise your brain and learn something new everyday.

Offline

#2 2022-02-07 20:01:36

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] umount file not deleting

Lizzy_Mae wrote:

Can't just rm -r, they are live system files.

No they aren't. The API filesystems are all under the "@" (root)  subvolume. As is /bin/bash.

You should have used

# mount -o subvol=@ /dev/sdd3 /fix
# mount -o subvol=@home /dev/sdd3 /fix/home

Then followed the ArchWiki chroot guide.

EDIT: welcome to the forums! :-)

Last edited by Head_on_a_Stick (2022-02-07 20:19:07)

Offline

#3 2022-02-07 23:14:32

Lizzy_Mae
Member
From: Lafayette, IN
Registered: 2022-02-07
Posts: 6

Re: [SOLVED] umount file not deleting

Head_on_a_Stick wrote:

No they aren't. The API filesystems are all under the "@" (root)  subvolume. As is /bin/bash.

Only reason I said they are live is because at reboot I missed boot F11 and it went to lightdm, so I brought up terminal and

ls -l / 

and it showed those directories with fresh timestamps (a minute apart), Ok, I'm going to rm them, worst case, ISO still plugged, coffee pot on timer when I get to it.

You should have used

# mount -o subvol=@ /dev/sdd3 /fix
# mount -o subvol=@home /dev/sdd3 /fix/home

Then followed the ArchWiki chroot guide.

Nowhere in the wiki does it say that, nor other guide I was going to use.

So, use what you have there, and then the proc, sys, dev mounts in wiki(s)? Had issues with 1st install of Arch with their wiki and ended using another and done. Search here is potluck and the wikis are I guess to much info for what needs to be said/done, or only basic starters. But I'm in for a long haul, both laptops are officially Micro$hit Windumbs free...lol

EDIT: welcome to the forums! :-)

Thank you

10hr shift awaits, nap, classes, probably carry both laptops for a day or two, learn code on one, stay broke while learning on other.

Lizzy Mae


Exercise your brain and learn something new everyday.

Offline

#4 2022-02-08 06:59:01

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] umount file not deleting

Lizzy_Mae wrote:

Only reason I said they are live is because at reboot I missed boot F11 and it went to lightdm, so I brought up terminal and

ls -l / 

and it showed those directories with fresh timestamps (a minute apart)

The API filesystems are created dynamically at boot so that is expected. You can mount the target partition (/dev/sdd3?) under /fix/ and check /fix/@/ to confirm they are present there as well as in /fix/.

Lizzy_Mae wrote:

You should have used

# mount -o subvol=@ /dev/sdd3 /fix
# mount -o subvol=@home /dev/sdd3 /fix/home

Then followed the ArchWiki chroot guide.

Nowhere in the wiki does it say that, nor other guide I was going to use.

The ArchWiki guide does not cover mounting the target system and only says

In the following example /location/of/new/root is the directory where the new root resides.

The other guide to which you link presumes an installation with separate partitions for root (/) and /home but you appear to have a single partition with separate subvolumes for root (/@)  and home (/@home).

Here's an example of a guide that covers a system using root & /home subvolumes instead of separate partitions (the "Btrfs filesystem with subvolumes" section):

https://fedoramagazine.org/os-chroot-10 … ubvolumes/

Offline

#5 2022-02-08 13:39:08

Lizzy_Mae
Member
From: Lafayette, IN
Registered: 2022-02-07
Posts: 6

Re: [SOLVED] umount file not deleting

Head_on_a_Stick wrote:

The ArchWiki guide does not cover mounting the target system and only says

In the following example /location/of/new/root is the directory where the new root resides.

The other guide to which you link presumes an installation with separate partitions for root (/) and /home but you appear to have a single partition with separate subvolumes for root (/@)  and home (/@home).

Here's an example of a guide that covers a system using root & /home subvolumes instead of separate partitions (the "Btrfs filesystem with subvolumes" section):

https://fedoramagazine.org/os-chroot-10 … ubvolumes/

Yes single partition root home, I figure with symlinking no need to for an extra partition, it was do I or don't I, and now maybe I should of seperated them.

Thank you for the link, copied to notes for later viewing. Was on break last night and a co-worked asked what I was doing. Rattled back fast like, btrfs subvolumns, she said but ass sub what nevermind. I was reading the kernel.ong btrfs wiki.

I also stopped for the most part using Arch in my search terms, finally noticing linux is linux. Like your link for Fedora.

No time to attempt the mission above, today is my loooong day of the week, but I do/will be searching out, listening to Pyradio (terminal radio), but will get to it after a hybernation tomorrow.

Thanks again,

Lizzy Mae


Exercise your brain and learn something new everyday.

Offline

#6 2022-02-09 17:09:50

Lizzy_Mae
Member
From: Lafayette, IN
Registered: 2022-02-07
Posts: 6

Re: [SOLVED] umount file not deleting

Hello,

The link above was very helpful, it was also the first link for btrfs chroot, and the comment section gave me more insight as well. Adding btrfs helps searching..lol

Here is my draft for evaluation:

# mount /dev/sdd3 /fix/
# ls /fix   (dev, proc, run, sys, tmp, @, @home)
# rm -r /dev/sdd3/fix/dev
# rm -r /dev/sdd3/fix/proc
# rm -r /dev/sdd3/fix/run
# rm -r /dev/sdd3/fix/sys
# rm -r /dev/sdd3/fix/tmp

** remove or leave the @ @home they were there originally or rm? **
**                  I'm guessing leave them and mount                                  **
**                     would cd /fix rm -r work?                                                   **

# mount -o subvol=@ /dev/sdd3 /fix
# mount -o subvol=@home /dev/sdd3 /fix/home
# mount -t proc /proc proc/  /fix
# mount -t sysfs /sys sys/   /fix
# mount --rbind /dev dev/    /fix
# chroot /fix

If this is correct, then I just treat it as the system. Or chroot bin/bash also

**examples** (Please)

chroot nano /etc/fstab
chroot su - lizzy -c mount /home OR @home
chroot tar -zcvf archive-name.tar.gz /directory/to/be/compressed    (probably irrelevant was just packaging something ..lol)

Does this all work the same if I remote into my other laptop like ssh to a server?

Thank you,
Lizzy Mae


Exercise your brain and learn something new everyday.

Offline

#7 2022-02-11 20:31:19

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] umount file not deleting

Sorry for the delayed response, $DAY_JOB has been busy recently.

Lizzy_Mae wrote:

Here is my draft for evaluation:

# mount /dev/sdd3 /fix/
# ls /fix   (dev, proc, run, sys, tmp, @, @home)
# rm -r /dev/sdd3/fix/dev
# rm -r /dev/sdd3/fix/proc
# rm -r /dev/sdd3/fix/run
# rm -r /dev/sdd3/fix/sys
# rm -r /dev/sdd3/fix/tmp

Those rm commands won't work because there are no directories under /dev/sdd3 so remove that bit.

I would use

# rm -r /fix/{dev,proc,run,sys,tmp}

See https://mywiki.wooledge.org/BraceExpansion for an explanation.

Lizzy_Mae wrote:

** remove or leave the @ @home they were there originally or rm? **

Leave them alone.

Lizzy_Mae wrote:
# mount -o subvol=@ /dev/sdd3 /fix
# mount -o subvol=@home /dev/sdd3 /fix/home
# mount -t proc /proc proc/  /fix
# mount -t sysfs /sys sys/   /fix
# mount --rbind /dev dev/    /fix
# chroot /fix

If this is correct, then I just treat it as the system. Or chroot bin/bash also

That should work. The chroot command assumes '"$SHELL" -i' as the command to be passed, which would probably  translate as '/bin/bash -i' in your system. This is explained in chroot(1), which you should have read before running the command. _Always_ read the relevant man page before running a new command and make sure you understand exactly what is going to happen when you run it. To read the info pages install the texinfo package.

Lizzy_Mae wrote:

**exxamples** (Please)

chroot nano /etc/fstab
chroot su - lizzy -c mount /home OR @home
chroot tar -zcvf archive-name.tar.gz /directory/to/be/compressed    (probably irrelevant was just packaging something ..lol)

Does this all work the same if I remote into my other laptop like ssh to a server?

Use the full path to any commands passed to chroot and use "/home" rather than "@home". The commands should all work the same from an ssh session.

Offline

#8 2022-02-12 20:32:53

Lizzy_Mae
Member
From: Lafayette, IN
Registered: 2022-02-07
Posts: 6

Re: [SOLVED] umount file not deleting

Hello,

Woooohooooo... just had to get that out of the way...lol

Head_on_a_Stick wrote:

Sorry for the delayed response, $DAY_JOB has been busy recently.

No problem, patience is in The Linux Help Guide. I'll trade you 2 full-time adventures of mine.. lol

Yes, I use braces when I create project folders where mistake can't harm anything.

This is explained in chroot(1), which you should have read before running the command. _Always_ read the relevant man page before running a new command and make sure you understand exactly what is going to happen when you run it. To read the info pages install the texinfo package.

Yes I already had chroot(1) and chroot(2) , along with bookoo other wikis and mans, I can read, look at my profile pic... lol, it is the decyphering of what I'm reading that I need to work on.

Use the full path to any commands passed... should all work the same from an ssh session.

Yes Yes Yes... I went and played, I can remote in or use SSH in. Don't worry, this is only for rescue missions if any should come along.  I acquired a 3rd laptop yesterday for re-doing someones Wordpress site as payment. It will be used for target practice for a while, learn how to get an Rsync backup in, etc. Have never had to use a backup yet, knock on wood (head), but never know when a bad update may hit. After that toss it in closet, keep chroot notes on USB.

After posting this, I am going to post in did post in  Hello Topic, can learn a bit more about my linux adventures, including what my cat gets (hint..lol.. any guesses? ..lol).

Thank You, Thank You!  I really do appreciate your time to help me.

Lizzy Mae

Last edited by Lizzy_Mae (2022-02-12 21:30:11)


Exercise your brain and learn something new everyday.

Offline

Board footer

Powered by FluxBB