realtebo
Posts: 37
Joined: Tue Apr 30, 2013 11:56 am

Unable to expand files system after distro-upgrade

Tue Mar 03, 2015 7:52 pm

After a dist-upgrade I redo

Code: Select all

sudo raspi-config
to expand file system.

But I got:
/dev/root does not exist or is not a symlink. Don't know how to expand
My dist-upgrade taken ... a lot of hours.. Is there anything I can do now?

Also, I thiks there is some error because

Code: Select all

pi@raspberrypi ~ $ df -h
File system     Dim. Usati Dispon. Uso% Montato su
/dev/root       7,2G  5,6G    1,3G  82% /
devtmpfs        460M     0    460M   0% /dev
tmpfs           464M     0    464M   0% /dev/shm
tmpfs           464M  6,6M    457M   2% /run
tmpfs           5,0M  4,0K    5,0M   1% /run/lock
tmpfs           464M     0    464M   0% /sys/fs/cgroup
/dev/mmcblk0p1   56M   15M     42M  26% /boot
tmpfs            93M     0     93M   0% /run/user/106
tmpfs            93M     0     93M   0% /run/user/1000
So /dev/root actually exists ! What's the problem?

DirkS
Posts: 10497
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Unable to expand files system after distro-upgrade

Tue Mar 03, 2015 8:54 pm

I don't know what causes the error message, but you don't have to redo the file expansion after a dist-upgrade.

rinky451
Posts: 37
Joined: Sun Nov 04, 2012 5:08 pm
Location: USA
Contact: Website Yahoo Messenger

Re: Unable to expand files system after distro-upgrade

Tue Mar 03, 2015 9:07 pm

not sure here but did the dist-upgrade make it throw the error.. Sometime that can be dangerious i thought for it pulls in everything. I too ran out of space on a 8 gig card and it was only 3.2 full. I tried to resize it thru gparted and that finished it. Next load I read bout Noobs install and the card is "expanded" on every reboot so you should not run into running out of room using Noobis install from what i have read.

User avatar
DougieLawson
Posts: 40486
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Unable to expand files system after distro-upgrade

Tue Mar 03, 2015 9:22 pm

The raspi-config option is for non-NOOBS installs only it's a once-off process.

NOOBS automagically expands the root filesystem to fill the available space (depends what else you install and if you add a "data" partition). That's a once-off process when NOOBS is doing the initial install.

If you're short of space, try cleaning some of the crud and cruft that accumulates. Or reformat the card and get rid of NOOBS (you can gain up to 1.7GB that way). Get rid of stuff you'll never use like wolfram or java or sonic-pi or scratch [add your selection here].

Clean up /var/cache/apt/archives there'll be a whole load of cruft in there. The official way to do that is with sudo apt-get autoremove && sudo apt-get autoclean. My way is cd /var/cache/apt/archives && sudo rm *.deb.
Clean up /var/log/*.gz (find /var/log -name "*gz" | xargs sudo rm) unless you like reading old logs that are full of noise. That is good bedtime reading, it's almost better than a cup of Horlicks for sending me to the land of nod.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

realtebo
Posts: 37
Joined: Tue Apr 30, 2013 11:56 am

Re: Unable to expand files system after distro-upgrade

Wed Mar 04, 2015 8:49 am

I first installed manually raspian wheezy on a 8gb sd card

Then I've done a dist-upgrade

Then I take an image of the sd

Then I copied the image on a 16 GB sd

Now I need to re-expand the file system.

DirkS
Posts: 10497
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Unable to expand files system after distro-upgrade

Wed Mar 04, 2015 9:57 am

What is the output of

Code: Select all

ls -la /dev/root

klricks
Posts: 7423
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Unable to expand files system after distro-upgrade

Wed Mar 04, 2015 1:22 pm

realtebo wrote:I first installed manually raspian wheezy on a 8gb sd card

Then I've done a dist-upgrade

Then I take an image of the sd

Then I copied the image on a 16 GB sd

Now I need to re-expand the file system.
after installing a fresh image I do the expand filessystem very first thing then reboot. I don't even draw another breath before that's done. The last time I 'forget' to do expand, I ran out of disk space just trying to do sudo apt-get update & upgrade.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

realtebo
Posts: 37
Joined: Tue Apr 30, 2013 11:56 am

Re: Unable to expand files system after distro-upgrade

Wed Mar 04, 2015 3:52 pm

Ok, and so what can I do now?

How I've said, I've migrated the system to another SD, so I've initially done the file system expansion, but now I need to re-do because my 8GB disk was near full

realtebo
Posts: 37
Joined: Tue Apr 30, 2013 11:56 am

Re: Unable to expand files system after distro-upgrade

Wed Mar 04, 2015 3:55 pm

DirkS wrote:What is the output of

Code: Select all

ls -la /dev/root

Code: Select all

pi@raspberrypi ~ $ ls -la /dev/root
ls: impossibile accedere a /dev/root: File o directory non esistente
"Unable to access to /dev/root. File or directory does not exists"

this is the output of df

Code: Select all


pi@raspberrypi ~ $ df
File system    1K-blocchi   Usati Disponib. Uso% Montato su
/dev/root         7513804 5289956   1868352  74% /
devtmpfs           470368       0    470368   0% /dev
tmpfs              474664       0    474664   0% /dev/shm
tmpfs              474664   12620    462044   3% /run
tmpfs                5120       4      5116   1% /run/lock
tmpfs              474664       0    474664   0% /sys/fs/cgroup
/dev/mmcblk0p1      57288   14736     42552  26% /boot
tmpfs               94936       0     94936   0% /run/user/106
tmpfs               94936       0     94936   0% /run/user/1000

DirkS
Posts: 10497
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Unable to expand files system after distro-upgrade

Wed Mar 04, 2015 4:31 pm

realtebo wrote:

Code: Select all

pi@raspberrypi ~ $ ls -la /dev/root
ls: impossibile accedere a /dev/root: File o directory non esistente
"Unable to access to /dev/root. File or directory does not exists"
raspi-config expects /dev/root to be a symbolic link, so this explains why it gives an error.

I have no idea why this happens though; I have not seen it before.
Maybe someone more knowledgeable has an answer to that...

realtebo
Posts: 37
Joined: Tue Apr 30, 2013 11:56 am

Re: Unable to expand files system after distro-upgrade

Tue Mar 10, 2015 8:05 am

How can I restore /dev/root symlink?

User avatar
rpdom
Posts: 17960
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Unable to expand files system after distro-upgrade

Tue Mar 10, 2015 8:32 am

As you installed Raspbian from an image file, rather than with NOOBS, your root (/) partition should be on /dev/mmcblk0p2. Check this with the "mount" command (on its own). It should show on the first line

Code: Select all

pi@raspi3 ~ $ mount
/dev/mmcblk0p2 on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=218604k,nr_inodes=54651,mode=755)
...
Then create a symlink with the "ln" command

Code: Select all

pi@raspi3 ~ $ sudo ln -s /dev/mmcblk0p2 /dev/root
pi@raspi3 ~ $ ls -l /dev/root
lrwxrwxrwx 1 root root 14 Mar 10 08:27 /dev/root -> /dev/mmcblk0p2

Return to “Beginners”