Page 1 of 1

Unable to expand files system after distro-upgrade

Posted: Tue Mar 03, 2015 7:52 pm
by realtebo
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?

Re: Unable to expand files system after distro-upgrade

Posted: Tue Mar 03, 2015 8:54 pm
by DirkS
I don't know what causes the error message, but you don't have to redo the file expansion after a dist-upgrade.

Re: Unable to expand files system after distro-upgrade

Posted: Tue Mar 03, 2015 9:07 pm
by rinky451
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.

Re: Unable to expand files system after distro-upgrade

Posted: Tue Mar 03, 2015 9:22 pm
by DougieLawson
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.

Re: Unable to expand files system after distro-upgrade

Posted: Wed Mar 04, 2015 8:49 am
by realtebo
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.

Re: Unable to expand files system after distro-upgrade

Posted: Wed Mar 04, 2015 9:57 am
by DirkS
What is the output of

Code: Select all

ls -la /dev/root

Re: Unable to expand files system after distro-upgrade

Posted: Wed Mar 04, 2015 1:22 pm
by klricks
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.

Re: Unable to expand files system after distro-upgrade

Posted: Wed Mar 04, 2015 3:52 pm
by realtebo
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

Re: Unable to expand files system after distro-upgrade

Posted: Wed Mar 04, 2015 3:55 pm
by realtebo
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

Re: Unable to expand files system after distro-upgrade

Posted: Wed Mar 04, 2015 4:31 pm
by DirkS
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...

Re: Unable to expand files system after distro-upgrade

Posted: Tue Mar 10, 2015 8:05 am
by realtebo
How can I restore /dev/root symlink?

Re: Unable to expand files system after distro-upgrade

Posted: Tue Mar 10, 2015 8:32 am
by rpdom
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