May 7, 2024

Can't take a backup of Linux! (Solved)

Hello everyone! This is my second post here. And it's about Linux (Crostini). I've been having issues with Linux since last year. It kept running out of space. It was mainly due to apps and updates. Eventually, it got so bad that it wouldn't even start up! So I expanded the partition. It was working for about a month if I remember right. Then it did it again and again. Up until it took all the space in the Chromebook. The issue is, I couldn't back it up. I formatted an SD Card (with enough space) to exFAT, but still to no avail. Then I learnt that Linux needed to start up in order for it backup. Which It won't. That's the reason I want to back it up and start over. But I can't. There is a lot of important data. Mainly some code. So is there any safe way of backing up? I lost access to Android recently. And the Chromebook has been slow ever since. I have about 320MB left of internal storage.

Out of 64GB, Linux took about 30GB of space!

Now, it tells me to update to Debian Bookworm (12) but I don't think that's a good idea due to the storage situation. So sadly I can't show the original error message that came up as it tells me to update. (Launching vmshell failed: Error starting crostini for terminal: 62 (NEED_UPDATE)).

Sorry for the long post. The Chrome OS version is 123.0.6312.134. (Update is available as of posting) I will update the version number after posting. Please let me know if you need more info. Please help. Thank you!
Locked
This question is locked and replying has been disabled.
Community content may not be verified or up-to-date. Learn more.
Last edited May 12, 2024
Recommended Answer
May 9, 2024
I agree with codesplice.

At this point it's time to cut your losses and take an option that will get your important data out of the virtual machine so you don't lose it. That's more important than using the backup command.

If you have a cloud drive or something that you can access via SFTP I would offer a command line utility that specializes in backing up and synchronizing data from one location to another.

There is a Linux command line app called Rclone that can synchronize your data  easily to USB drive or memory card or pC or server.  It installs with a simple script and is only one file.

Actually, the utility and it's companion graphical user interface app are both in the Debian repository.

sudo apt install rclone
sudo apt install rclone-browser

Then, I can give you brief instructions that you will need to do the backup.

You can also use the files app to just copy the files that you want to your external drive.

Considering the status of your machine you might want to just copy and paste from the file manager. 



Original Poster shobana v 5497 marked this as an answer
Kudos awarded by shobana v 5497:
Fast
Helpful?
Recommended Answer
May 9, 2024
Sorry for leaving you hanging, I came down with some sort of illness that put me out of commission for ~24 hours. Nice work with restoring the backup of the /etc/passwd file!

So now you're able to launch the Linux environment normally but attempting to back up to an SD card hangs at ~10%?

If the backup process isn't working, you might want to just copy the important data directly to the SD card.

Original Poster shobana v 5497 marked this as an answer
Kudos awarded by shobana v 5497:
Accurate
Helpful?
Recommended Answer
May 12, 2024
Hello, Something significant happened! So I found a few files in the home folder called:
trinity-testfile1,2 and 3. For more context, I saw that the home folder was using 18 PiB?! I ignored it thinking it was just a corruption. I've seen Linux misreport folder sizes before. But no. When I tried to back the folders up manually, It said it needed 18 PiB of space! Eventually, I found that ​trinity-testfile3 ​was 18 PiB! So I looked the files up but couldn't find any info about it. So I deleted it. Along with a few log files called trinity-child0, 1, 2, etc.log. I first backed up the files manually yesterday. Then, today I tried to back it up using the settings app again, and voila! It worked! It wasn't stuck on 10% Anymore! Thank you all for the support!
Product Expert Alumni codesplice recommended this
Helpful?
Recommended Answer
May 8, 2024
Hello, I fixed the passwd ​file issues by taking a backup of the /etc/passwd- file and renaming it to passwd ​and restarted it. And I finally got into Linux. An error popped up a few times. Sadly I didn't copy it so I forgot. But it disappeared by itself. It said something along the lines of "Failed to Create vshd for container penguin. The container does not exist.". I don't know what exactly caused it to go away. Anyways I got in. It wouldn't have been possible without your help. Thank You all! I am currently in the process of backing it up! It did give me an error while backing up Linux notification but I shut down Linux and did the backup and it worked!  Thank you all again!
Diamond Product Expert Joe Ellett recommended this
Helpful?
All Replies (5)
May 7, 2024
I can't edit the post so here's a reply: I updated to 124.0.6367.95. Still won't take a backup. Weirdly enough, It freed up space. And I have about 520MB of space. And I got Android back. But this happened before and it will take more space up again. Though Linux is taking about a 100MB more space now, I think the update actually made the System take a little less. But Linux is still refusing to startup. I managed to get the original error: Launching vmshell failed: Error starting crostini for terminal: 58 (START_CONTAINER_TIMED_OUT). It is just timing out because it won't start. Kindly help!
May 7, 2024
It sounds like the real issue here is not being able to start the Linux environment at all, which is preventing you from either retrieving files or backing it up. 

Do you have any space you could free up within ChromeOS? Removing downloaded files, installed Android apps, and those sorts of things? In fact, disabling the Android environment as a whole may help. 

Have you tried manually starting the environment?

Start by pulling up the Chrome OS developer shell (Ctrl + Alt + T) and executing 'vmc list'. If it's there, you should see information about the termina VM returned:
 
crosh> vmc list
termina
Total Size (bytes): 3939495936
 
If it's there, try manually starting it with 'vmc start termina':
 
crosh> vmc start termina
(termina) chronos@localhost ~ $
 
You can then check for the default Linux container (named penguin) with 'lxc list':
 
(termina) chronos@localhost ~ $ lxc list
To start your first container, try: lxc launch ubuntu:18.04
 
+---------+---------+------+------+------------+-----------+
|  NAME   |  STATE  | IPV4 | IPV6 |    TYPE    | SNAPSHOTS |
+---------+---------+------+------+------------+-----------+
| penguin | STOPPED |      |      | PERSISTENT | 0         |
+---------+---------+------+------+------------+-----------+
 
If the penguin container is listed, you can try manually starting it as well - but you'll want to logout back to the crosh prompt and then execute 'vmc container termina penguin':
 
(termina) chronos@localhost ~ $ logout
crosh> vmc container termina penguin
jbowdre@penguin:~$ 
 
These commands may or may not fix the problem but I hope they will at least provide a bit more information about the issue(s) you're encountering. 



May 7, 2024
Yikes.

Can you try `cat /etc/passwd`? 
May 8, 2024
I did this and there is no output. But I did an ​ls /etc/​ and found two files. One was "passwd" and the other was "passwd-". So I did ​ cat /etc/passwd- and got an output:

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
systemd-timesync:x:101:102:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
systemd-network:x:102:103:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:103:104:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
messagebus:x:104:105::/nonexistent:/usr/sbin/nologin
rtkit:x:105:111:RealtimeKit,,,:/proc:/usr/sbin/nologin
sshd:x:106:65534::/run/sshd:/usr/sbin/nologin
pulse:x:107:112:PulseAudio daemon,,,:/var/run/pulse:/usr/sbin/nologin
username:x:1000:1000:username:/home/username:/bin/bash
chronos-access:x:1001:1001:chronos-access:/dev/null:/bin/false
android-everybody:x:665357:665357:android-everybody:/dev/null:/bin/false
android-root:x:655360:655360:android-root:/dev/null:/bin/false
systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin
usbmux:x:108:46:usbmux daemon,,,:/var/lib/usbmux:/usr/sbin/nologin
tss:x:109:114:TPM software stack,,,:/var/lib/tpm:/bin/false
_flatpak:x:110:115:Flatpak system-wide installation helper,,,:/nonexistent:/usr/sbin/nologin
geoclue:x:111:116::/var/lib/geoclue:/usr/sbin/nologin
avahi:x:112:117:Avahi mDNS daemon,,,:/run/avahi-daemon:/usr/sbin/nologin
saned:x:113:119::/var/lib/saned:/usr/sbin/nologin
dnsmasq:x:114:65534:dnsmasq,,,:/var/lib/misc:/usr/sbin/nologin
colord:x:115:121:colord colour management daemon,,,:/var/lib/colord:/usr/sbin/nologin
Debian-gdm:x:116:122:Gnome Display Manager:/var/lib/gdm3:/bin/false
lightdm:x:117:123:Light Display Manager:/var/lib/lightdm:/bin/false
uuidd:x:118:124::/run/uuidd:/usr/sbin/nologin

​​Again, I changed my actual username to just "username". Otherwise it's still the output I got.

Should I try renaming the "passwd" file to "passwd.old" and rename the "passwd-" file to "passwd"? This could be a potential solution. I also found another file called "passwd.org" ​which has the same output as the "passwd-" file. Thank you!
May 8, 2024
I have also run into problems getting backup to work properly. I solved the problem by installing open SSH server and putting it on port 2222 and then in settings you enable port forwarding So port 2222 Gets forwarded to the host.

 The first step is to look through your chrome OS files for as much as you can delete to free up space on the disk so that you can further expand the Linux container in the hopes that that will enable it to start.

Then, from my other PC i use a program called free file sync that is capable of connecting to the Chromebook over SFTP and that lets me back up all of my directories and files in my home folder to a local SSD drive.

This option would be predicated on you being able to free up enough space to get the Linux container to startup correctly.


May 8, 2024
Hi,

I think I figured it out.

  1. Accessing the Linux Container in crosh:
    • Open a crosh terminal by pressing Ctrl + Alt + T.
    • Type vmc start termina to start the Linux container.
    • Then, enter the Linux shell by typing vmc container termina penguin.
  2. Transferring Files from Linux to Chrome OS:
    • To copy files from the Linux container to Chrome OS, you can use the cp command.
    • For example, if you want to copy a file named my_file.txt from the Linux container to your Chrome OS Downloads folder, use the following command:
      cp /path/to/my_file.txt /mnt/chromeos/MyFiles/Downloads/
    • Replace /path/to/my_file.txt with the actual path to your file within the Linux container.
    • Similarly, adjust the destination path to the desired location in Chrome OS (e.g., DownloadsDocuments, etc.).

When I ran "vmc container termina penguin" I landed in my Linux home directory.

From there, your chromeos MyFiles is located in /mnt/chromeos/MyFiles

Give this a try. It works for me.



May 8, 2024
Hello, Thank you for the reply. I'm sorry but this is the issue that we are trying to fix. If I do​ vmc container termina penguin​, I get an error about a corrupted passwd file. Which we are trying to fix. So I can't access files until I fix that. Also I have to back up to an SD Card. So what is the path to access the SD card through Linux? Should I just share the folder to Linux and find it that way? Or is there already a directory where the SD Card is mounted? If I can get the container up and running, I prefer to do a full backup, as I can restore with just a few clicks, but if I can't then it's fine.

To do this, I found something interesting. So after a few steps instructed by Codesplice, we managed to confirm that the /etc/passwd file was empty. I did an ​ls /etc/​ and found another two ​​similarly named files. ​/etc/passwd- ​and ​/etc/passwd.org​. And both of them have the same output. So I think that renaming the empty passwd ​file to ​passwd.old​ and renaming either passwd- ​or ​passwd.org
​to ​passwd​, could fix the issue. Please tell me whether this is safe to do or not. As I don't want to lose at least a partially working Linux Container. 
 
Last edited May 8, 2024
Recommended Answer
May 8, 2024
Hello, I fixed the passwd ​file issues by taking a backup of the /etc/passwd- file and renaming it to passwd ​and restarted it. And I finally got into Linux. An error popped up a few times. Sadly I didn't copy it so I forgot. But it disappeared by itself. It said something along the lines of "Failed to Create vshd for container penguin. The container does not exist.". I don't know what exactly caused it to go away. Anyways I got in. It wouldn't have been possible without your help. Thank You all! I am currently in the process of backing it up! It did give me an error while backing up Linux notification but I shut down Linux and did the backup and it worked!  Thank you all again!
Diamond Product Expert Joe Ellett recommended this
May 9, 2024
If you're trying to back up the files from your home directory, you can probably safely skip the entire .config directory; that's typically used for storing application configurations and caches and not for your personal data or files.

I'd focus on grabbing the individual files/folders that you know you want to preserve, and leave behind everything else. 
May 10, 2024
Thank You for the tip! I will just back up the needed config files from ~/.config and other directories! I also found that there was a snapshot taken by ​lxc​. After entering the command ​lxc info penguin​ I got some information. Along which, was this:

Snapshots:
+---------------+----------------------+------------+----------+
|     NAME      |       TAKEN AT       | EXPIRES AT | STATEFUL |
+---------------+----------------------+------------+----------+
| rootfs-backup | 2024/05/09 19:56 IST |            | NO       |
+---------------+----------------------+------------+----------+

There is an existing snapshot. But it was taken at the same time I was trying to back Linux up using the settings app...  Is it safe to delete? The backup didn't fully complete. So it may be corrupted. Thank You!
Recommended Answer
May 12, 2024
Hello, Something significant happened! So I found a few files in the home folder called:
trinity-testfile1,2 and 3. For more context, I saw that the home folder was using 18 PiB?! I ignored it thinking it was just a corruption. I've seen Linux misreport folder sizes before. But no. When I tried to back the folders up manually, It said it needed 18 PiB of space! Eventually, I found that ​trinity-testfile3 ​was 18 PiB! So I looked the files up but couldn't find any info about it. So I deleted it. Along with a few log files called trinity-child0, 1, 2, etc.log. I first backed up the files manually yesterday. Then, today I tried to back it up using the settings app again, and voila! It worked! It wasn't stuck on 10% Anymore! Thank you all for the support!
Product Expert Alumni codesplice recommended this
May 13, 2024
Awesome, I'm glad you got it figured out! Thanks for sharing your solution.
May 17, 2024
Thank you for setting this as an answer! Thank you all for giving me the support that I needed to get to this stage!
false
8126407506304216094
true
Search Help Center
true
true
true
true
true
208
Search
Clear search
Close search
Main menu
false