MacsandaPi
Posts: 95
Joined: Tue Dec 30, 2014 7:44 pm

Running Raspbian from external hard drive--"no space left"

Thu Mar 22, 2018 7:51 pm

I have the latest version of Raspbian Stretch with Desktop installed on a first-generation Pi2 B. It is running from an attached USB hard drive (160GB). When I attempted to update/upgrade Stretch after first booting into the external hard drive, a message appears in the Terminal, “Error writing to output file - write (28: No space left). The

Code: Select all

df -h
command doesn’t show the space that should be available—something like 140 GB should be unused and available. Also, the /sda2 partition (root) isn’t shown.

So, my questions:
1. Is the pi really running from the external hard drive?
2. If no, how to fix that?
3. If it is running from the external drive, how do I make all unused space on the hard drive available?

Thanks in advance for your help.

User avatar
PeterO
Posts: 5456
Joined: Sun Jul 22, 2012 4:14 pm

Re: Running Raspbian from external hard drive--"no space left"

Thu Mar 22, 2018 11:21 pm

What is the output from running "mount" ?
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

MacsandaPi
Posts: 95
Joined: Tue Dec 30, 2014 7:44 pm

Re: Running Raspbian from external hard drive--"no space left"

Fri Mar 23, 2018 3:33 am

PeterO, thank you for your reply. Here's the output of "mount":

Code: Select all

[email protected]:~ $ mount
/dev/sda2 on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=470184k,nr_inodes=117546,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=31,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/sda1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=94956k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/mmcblk0p2 on /media/pi/rootfs type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)
/dev/mmcblk0p1 on /media/pi/boot type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)
[email protected]:~ $ 

User avatar
HawaiianPi
Posts: 5203
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Running Raspbian from external hard drive--"no space left"

Fri Mar 23, 2018 3:33 am

MacsandaPi wrote:
Thu Mar 22, 2018 7:51 pm
So, my questions:
1. Is the pi really running from the external hard drive?
That depends... how did you enable that functionality?
  • The first generation Pi2B does not support direct USB boot.
  • You must use a specially prepared SD card to start the boot process.
MacsandaPi wrote:
Thu Mar 22, 2018 7:51 pm
2. If no, how to fix that?
There are 2 ways to do that:
  1. Use a FAT32 formtted SD card with only bootcode.bin on it.
  2. Keep the boot partition on the SD card, and the root filesystem on the HDD. *See note at end...
MacsandaPi wrote:
Thu Mar 22, 2018 7:51 pm
3. If it is running from the external drive, how do I make all unused space on the hard drive available?
Install the GNOME Partition Editor and resize it (sudo apt install gparted).

*Note
For the second method you must edit cmdline.txt on the SD card to point root at the HDD partition, and edit /etc/fstab on the HDD to mount everything correctly (HDD as / and SD card as /boot).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

MacsandaPi
Posts: 95
Joined: Tue Dec 30, 2014 7:44 pm

Re: Running Raspbian from external hard drive--"no space left"

Fri Mar 23, 2018 4:48 am

HawaiianPi, many thanks for your reply.

That depends... how did you enable that functionality?
    The steps I followed:
    1.Used Etcher to copy the zip file of the latest version of Stretch with Desktop to the microSD card and external USB drive.
    2.Booted the SD card, plugged in the external HDD.
    3.Used sudo blkid to identify the root portion of the HD (sda2) and copied the PARTUUID to the "root= " portion of /boot/cmdline.txt.
    4.Rebooted.
    [*]The first generation Pi2B does not support direct USB boot.
    Previously, I had my RPi2B running from the same external hard drive I'm now using. This was with a version of Jessie (and the setup was much, much easier than what I'm now trying to deal with).
    [*]You must use a specially prepared SD card to start the boot process.
    There are 2 ways to do that:
    1. Use a FAT32 formtted SD card with only bootcode.bin on it.
    I attempted to use the FAT32 SD card and the bootcode.bin on it, but the boot process stalled at the initial splash screen.
    [*]Keep the boot partition on the SD card, and the root filesystem on the HDD. *See note at end...
    This is what I was attempting to do from the steps above.
    Install the GNOME Partition Editor and resize it (sudo apt install gparted).
    *Note
    For the second method you must edit cmdline.txt on the SD card to point root at the HDD partition, and edit /etc/fstab on the HDD to mount everything correctly (HDD as / and SD card as /boot).
    As you may have noted from the steps listed above, I did not edit /etc/fstab on the HDD.

    Hope this explanation helps in understanding what I did to get to this point.

    User avatar
    HawaiianPi
    Posts: 5203
    Joined: Mon Apr 08, 2013 4:53 am
    Location: Aloha, Oregon USA

    Re: Running Raspbian from external hard drive--"no space left"

    Fri Mar 23, 2018 5:24 am

    MacsandaPi wrote:
    Fri Mar 23, 2018 4:48 am
    The steps I followed:
    1.Used Etcher to copy the zip file of the latest version of Stretch with Desktop to the microSD card and external USB drive.
    2.Booted the SD card, plugged in the external HDD.
    3.Used sudo blkid to identify the root portion of the HD (sda2) and copied the PARTUUID to the "root= " portion of /boot/cmdline.txt.
    4.Rebooted.
    Have you verified that the PARTUUID is different from your SD card?
    MacsandaPi wrote:
    Fri Mar 23, 2018 4:48 am
    Previously, I had my RPi2B running from the same external hard drive I'm now using. This was with a version of Jessie (and the setup was much, much easier than what I'm now trying to deal with).
    Setup should be the same. In fact, it was harder with earlier versions of Jessie.
    MacsandaPi wrote:
    Fri Mar 23, 2018 4:48 am
    I attempted to use the FAT32 SD card and the bootcode.bin on it, but the boot process stalled at the initial splash screen.
    Do you have another USB storage device connected?
    MacsandaPi wrote:
    Fri Mar 23, 2018 4:48 am
    As you may have noted from the steps listed above, I did not edit /etc/fstab on the HDD.

    Hope this explanation helps in understanding what I did to get to this point.
    Please post the contents of /etc/fstab on both your SD card and HDD, as well as the output of:

    Code: Select all

    ls -l /dev/disk/by-partuuid
    My mind is like a browser. 27 tabs are open, 9 aren't responding,
    lots of pop-ups...and where is that annoying music coming from?

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

    Re: Running Raspbian from external hard drive--"no space left"

    Fri Mar 23, 2018 5:33 am

    Run sudo raspi-config, go to "7 Advanced Options", then select "A1 Expand Filesystem" and let it run.

    As you are initially booting from the SD card, the automatic expansion on first boot happened on the card, not the disk, so you need to run it manually on the disk.

    I expect if you did a df -h / you would see 100% used and less than 6GB total space.

    User avatar
    PeterO
    Posts: 5456
    Joined: Sun Jul 22, 2012 4:14 pm

    Re: Running Raspbian from external hard drive--"no space left"

    Fri Mar 23, 2018 8:22 am

    MacsandaPi wrote:
    Fri Mar 23, 2018 3:33 am
    PeterO, thank you for your reply. Here's the output of "mount":

    Code: Select all

    [email protected]:~ $ mount
    /dev/sda2 on / type ext4 (rw,noatime,data=ordered)
    /dev/sda1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
    /dev/mmcblk0p2 on /media/pi/rootfs type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)
    /dev/mmcblk0p1 on /media/pi/boot type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)
    
    That all looks good, the hard disk is mounted on / and /boot as it should be.
    The sdcard that it booted from is also mounted in /media/pi

    But there is a problem.

    This is a 2B, so booting is happening from the files in the fat32 partition on the sdcard, but when the system has booted the fat32 partition on the disk is now mounted on /boot. This means that any updates are applied to the /boot directory go onto the disk and NOT on to the card where they are needed to perform the boot process.

    Please post the contents of /etc/fstab.

    AH I now see HawaiianPi has identified the same issues ("Great Minds" etc etc). But I've found that the "bootcode.bin only" method does NOT work with PI2B V1.1 boards but DOES work with V1.2 boards. On my V1.1 board I've settled for a fully populated /boot mounted from the sdcard and just / mounted from the hard disk .

    HTH

    PeterO
    Discoverer of the PI2 XENON DEATH FLASH!
    Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
    "The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

    MacsandaPi
    Posts: 95
    Joined: Tue Dec 30, 2014 7:44 pm

    Re: Running Raspbian from external hard drive--"no space left"

    Fri Mar 23, 2018 5:52 pm

    HawaiianPi wrote:
    Fri Mar 23, 2018 5:24 am
    Have you verified that the PARTUUID is different from your SD card?
    I looked at the ouptut from "sudo blkid" in step 3 above and determined that the PARTUUID number for "rootfs" was different between the SD card and HD. Is that what you mean?
    MacsandaPi wrote:
    Fri Mar 23, 2018 4:48 am
    I attempted to use the FAT32 SD card and the bootcode.bin on it, but the boot process stalled at the initial splash screen.
    Do you have another USB storage device connected?
    The only storage devices connected at the time were the SD card and the external HD.
    MacsandaPi wrote:
    Fri Mar 23, 2018 4:48 am
    As you may have noted from the steps listed above, I did not edit /etc/fstab on the HDD.

    Hope this explanation helps in understanding what I did to get to this point.
    Please post the contents of /etc/fstab on both your SD card and HDD, as well as the output of:

    Code: Select all

    ls -l /dev/disk/by-partuuid
    I'm sorry, but I don't know how to find the contents of /etc/fstab for either the SD or HDD. There's no icon of the devices on the desktop, so I can't use the File Manager to help; and I don't know the terminal commands to navigate to rthe right directories. As you requested, here's the output of ls -l /dev/disk/by-partuuid:

    Code: Select all

    [email protected]:~ $ ls -l /dev/disk/by-partuuid
    total 0
    lrwxrwxrwx 1 root root 10 Mar 13 16:17 15ca46a5-01 -> ../../sda1
    lrwxrwxrwx 1 root root 10 Mar 13 16:17 15ca46a5-02 -> ../../sda2
    lrwxrwxrwx 1 root root 15 Mar 13 16:17 4a9af90c-01 -> ../../mmcblk0p1
    lrwxrwxrwx 1 root root 15 Mar 13 16:17 4a9af90c-02 -> ../../mmcblk0p2
    [email protected]:~ $ 
    
    Thank you for the time you're taking to help!

    User avatar
    PeterO
    Posts: 5456
    Joined: Sun Jul 22, 2012 4:14 pm

    Re: Running Raspbian from external hard drive--"no space left"

    Fri Mar 23, 2018 6:12 pm

    To show the contents of /etc/fstab tyoe this command into a command window....

    Code: Select all

    cat /etc/fstab
    
    PeterO
    Discoverer of the PI2 XENON DEATH FLASH!
    Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
    "The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

    MacsandaPi
    Posts: 95
    Joined: Tue Dec 30, 2014 7:44 pm

    Re: Running Raspbian from external hard drive--"no space left"

    Fri Mar 23, 2018 6:16 pm

    rpdom wrote:
    Fri Mar 23, 2018 5:33 am
    Run sudo raspi-config, go to "7 Advanced Options", then select "A1 Expand Filesystem" and let it run.

    As you are initially booting from the SD card, the automatic expansion on first boot happened on the card, not the disk, so you need to run it manually on the disk.

    I expect if you did a df -h / you would see 100% used and less than 6GB total space.
    You are correct!

    Code: Select all

    [email protected]:~ $ df -h
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/root       4.5G  4.2G   39M 100% /
    devtmpfs        460M     0  460M   0% /dev
    tmpfs           464M   24M  441M   5% /dev/shm
    tmpfs           464M   13M  452M   3% /run
    tmpfs           5.0M  4.0K  5.0M   1% /run/lock
    tmpfs           464M     0  464M   0% /sys/fs/cgroup
    /dev/sda1        42M   21M   21M  51% /boot
    tmpfs            93M     0   93M   0% /run/user/1000
    /dev/mmcblk0p2  7.2G  4.1G  2.8G  61% /media/pi/rootfs
    /dev/mmcblk0p1   42M   21M   21M  51% /media/pi/boot
    So if I now run "A1 Expand Filesystem" will that make all of the presently unused space (140+GB) on the external HD available?

    MacsandaPi
    Posts: 95
    Joined: Tue Dec 30, 2014 7:44 pm

    Re: Running Raspbian from external hard drive--"no space left"

    Fri Mar 23, 2018 6:20 pm

    PeterO wrote:
    Fri Mar 23, 2018 6:12 pm
    To show the contents of /etc/fstab tyoe this command into a command window....

    Code: Select all

    cat /etc/fstab
    
    PeterO
    Thank you! Here's the output:

    Code: Select all

    [email protected]:~ $ cat /etc/fstab
    proc            /proc           proc    defaults          0       0
    PARTUUID=15ca46a5-01  /boot           vfat    defaults          0       2
    PARTUUID=15ca46a5-02  /               ext4    defaults,noatime  0       1
    # a swapfile is not a swap partition, no line here
    #   use  dphys-swapfile swap[on|off]  for that
    [email protected]:~ $ 
    

    User avatar
    PeterO
    Posts: 5456
    Joined: Sun Jul 22, 2012 4:14 pm

    Re: Running Raspbian from external hard drive--"no space left"

    Fri Mar 23, 2018 6:46 pm

    rpdom wrote:
    Fri Mar 23, 2018 5:33 am
    Run sudo raspi-config, go to "7 Advanced Options", then select "A1 Expand Filesystem" and let it run.
    I don't think that will work as raspi-config has code in it specific to resizing the partition and filesystem on an sdcard (lots of mentions of /dev/mmcblk0
    like this " LAST_PART_NUM=$(parted /dev/mmcblk0 -ms unit s p | tail -n 1 | cut -f 1 -d:)" )

    The code that runs on first boot that will resize a usb hdd is in /usr/lib/raspi-config/init_resize.sh

    PeterO
    Discoverer of the PI2 XENON DEATH FLASH!
    Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
    "The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

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

    Re: Running Raspbian from external hard drive--"no space left"

    Fri Mar 23, 2018 7:33 pm

    MacsandaPi wrote:
    Fri Mar 23, 2018 6:16 pm
    So if I now run "A1 Expand Filesystem" will that make all of the presently unused space (140+GB) on the external HD available?
    I think that works on USB storage now, as well as SD card. If not, there are manual ways to do it which we can guide you through.

    User avatar
    PeterO
    Posts: 5456
    Joined: Sun Jul 22, 2012 4:14 pm

    Re: Running Raspbian from external hard drive--"no space left"

    Fri Mar 23, 2018 7:45 pm

    rpdom wrote:
    Fri Mar 23, 2018 7:33 pm
    MacsandaPi wrote:
    Fri Mar 23, 2018 6:16 pm
    So if I now run "A1 Expand Filesystem" will that make all of the presently unused space (140+GB) on the external HD available?
    I think that works on USB storage now, as well as SD card. If not, there are manual ways to do it which we can guide you through.
    Really ? It seems pretty clear if you look at the code !....

    Code: Select all

    do_expand_rootfs() {
      ROOT_PART=$(mount | sed -n 's|^/dev/\(.*\) on / .*|\1|p')
    
      PART_NUM=${ROOT_PART#mmcblk0p}
      if [ "$PART_NUM" = "$ROOT_PART" ]; then
        whiptail --msgbox "$ROOT_PART is not an SD card. Don't know how to expand" 20 60 2
        return 0
      fi
    
    PeterO
    Discoverer of the PI2 XENON DEATH FLASH!
    Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
    "The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

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

    Re: Running Raspbian from external hard drive--"no space left"

    Fri Mar 23, 2018 9:48 pm

    PeterO wrote:
    Fri Mar 23, 2018 7:45 pm
    rpdom wrote:
    Fri Mar 23, 2018 7:33 pm
    MacsandaPi wrote:
    Fri Mar 23, 2018 6:16 pm
    So if I now run "A1 Expand Filesystem" will that make all of the presently unused space (140+GB) on the external HD available?
    I think that works on USB storage now, as well as SD card. If not, there are manual ways to do it which we can guide you through.
    Really ? It seems pretty clear if you look at the code !....
    I'll admit I haven't looked at the code. I had a feeling that the latest version allowed for that, but it seems I am wrong (I'm not going to look at the code, I believe you are right).

    MacsandaPi
    Posts: 95
    Joined: Tue Dec 30, 2014 7:44 pm

    Re: Running Raspbian from external hard drive--"no space left"

    Fri Mar 23, 2018 11:06 pm

    What is the next step? Somehow expand the HDD to make its full capacity available by using GParted and/or some other method?

    BTW, I hadn't noticed this before, but "lsblk" shows that 149.1GB are available on sda (if this is relevant):

    Code: Select all

    [email protected]:~ $ lsblk
    NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sda           8:0    0 149.1G  0 disk 
    |-sda1        8:1    0  41.8M  0 part /boot
    `-sda2        8:2    0   4.6G  0 part /
    mmcblk0     179:0    0   7.4G  0 disk 
    |-mmcblk0p1 179:1    0  41.8M  0 part /media/pi/boot
    `-mmcblk0p2 179:2    0   7.3G  0 part /media/pi/rootfs
    [email protected]:~ $ 
    
    My continuing thanks to PeterO, HawaiianPi and rpdom for your help with this problem.

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

    Re: Running Raspbian from external hard drive--"no space left"

    Sat Mar 24, 2018 4:46 am

    Because it is a bit tricky to resize a partition that is in use, (I'm not that familiar with gparted, it may be able to do it in two steps), it may be easier to boot off the SD card with the USB disk unplugged, then connect the USB disk and run gparted on /dev/sda2 from there.

    User avatar
    HawaiianPi
    Posts: 5203
    Joined: Mon Apr 08, 2013 4:53 am
    Location: Aloha, Oregon USA

    Re: Running Raspbian from external hard drive--"no space left"

    Sat Mar 24, 2018 9:36 am

    rpdom wrote:
    Sat Mar 24, 2018 4:46 am
    Because it is a bit tricky to resize a partition that is in use, (I'm not that familiar with gparted, it may be able to do it in two steps), it may be easier to boot off the SD card with the USB disk unplugged, then connect the USB disk and run gparted on /dev/sda2 from there.
    Yup, that would be the best way to do it. Use another SD card since your current one is configured to load the OS from HDD. Once you have the size sorted out, reboot from your card that loads the OS from the HDD and continue below.

    I've been quite ill for the last couple of days, so I hope I'm still on the same page here. It seems you have the SD card configured to load the rootfs from the HDD, but the SD card is not mounted as /boot so firmware and kernel updates are not being applied correctly (to the SD card). If that is correct, then we can fix that by editing the /etc/fstab file.

    We'll use the GUI text editor, but launch it as root. Open a terminal and enter:

    Code: Select all

    gksudo leafpad /etc/fstab
    Based on what you posted earlier you should see the following:

    Code: Select all

    proc            /proc           proc    defaults          0       0
    PARTUUID=15ca46a5-01  /boot           vfat    defaults          0       2
    PARTUUID=15ca46a5-02  /               ext4    defaults,noatime  0       1
    # a swapfile is not a swap partition, no line here
    #   use  dphys-swapfile swap[on|off]  for that
    
    Change the first instance of PARTUUID=15ca46a5-01 to /dev/mmcblk0p1

    Code: Select all

    proc            /proc           proc    defaults          0       0
    /dev/mmcblk0p1  /boot           vfat    defaults          0       2
    PARTUUID=15ca46a5-02  /               ext4    defaults,noatime  0       1
    # a swapfile is not a swap partition, no line here
    #   use  dphys-swapfile swap[on|off]  for that
    
    Save the file and close leafpad.

    This will mount the 1st SD card partition as /boot for the running OS so that firmware & kernel updates are applied correctly (to the SD card).

    Now let's copy the updates you currently have to the SD card before you reboot.

    This time we'll open the GUI file manager as root:

    Code: Select all

    gksudo pcmanfm
    Navigate to /boot and then select all and copy, then navigate to /media/pi/boot and paste, overwriting the files there.

    Reboot your Pi2 and it should boot from the SD card then load and run the root OS from the HDD. The mount command should show the 1st SD card partition mounted in /boot and the 2nd HDD partition mounted as / (root). You now have a couple of unused partitions (SD card partition-2 and HDD partition-1). If you want to get rid of those we can help you with that (although it might be easier to start over from scratch).

    Oh, and 149GB is normal for a "160GB" hard drive. The usable capacity is always about 7% less than the advertised capacity due to some marketing nonsense in the way it's calculated.
    My mind is like a browser. 27 tabs are open, 9 aren't responding,
    lots of pop-ups...and where is that annoying music coming from?

    MacsandaPi
    Posts: 95
    Joined: Tue Dec 30, 2014 7:44 pm

    Re: Running Raspbian from external hard drive--"no space left"

    Sat Mar 24, 2018 4:26 pm

    rpdom wrote:
    Sat Mar 24, 2018 4:46 am
    Because it is a bit tricky to resize a partition that is in use, (I'm not that familiar with gparted, it may be able to do it in two steps), it may be easier to boot off the SD card with the USB disk unplugged, then connect the USB disk and run gparted on /dev/sda2 from there.
    OK, thanks--I need to purchase another SD card and get Stretch flashed to that before continuing. Will do.

    MacsandaPi
    Posts: 95
    Joined: Tue Dec 30, 2014 7:44 pm

    Re: Running Raspbian from external hard drive--"no space left"

    Sat Mar 24, 2018 4:42 pm

    HawaiianPi wrote:
    Sat Mar 24, 2018 9:36 am
    Yup, that would be the best way to do it. Use another SD card since your current one is configured to load the OS from HDD.
    I'm off to buy another SD card. Just to confirm, the steps then will be:
    1.Flash Stretch to new card.
    2.Replace current SD card with newly-flashed Stretch.
    3.Reboot.
    4.Plug in USB HD.
    5.Use GParted to resize the partition on the HD that contains the root file system (sda2).
    If those are correct, then I'll need help when it comes time to use GParted.
    I've been quite ill for the last couple of days, so I hope I'm still on the same page here.
    Sorry to learn that you've been ill; hope you're feeling better by now.

    MacsandaPi
    Posts: 95
    Joined: Tue Dec 30, 2014 7:44 pm

    Re: Running Raspbian from external hard drive--"no space left"

    Sat Mar 24, 2018 8:09 pm

    I bought a new microSD card and flashed the Stretch zip file to it, so I'm ready to boot the RPi2B with that and try to use GParted to resize the HDD. However, it occurred to me that I already have GParted installed on my Linux Mint machine. Could I just plug the USB HDD into the Linux Mint machine and use GParted to try to expand the HDD?

    The GParted.png attachment shows the window when GParted is opened. I assume I should:
    1. select /dev/sdb2 and right-click on it,
    2. select unmount,
    3. and then choose resize?

    The Resize.png attachment shows GParted's resize window. Should I change "New size" to 147908?

    file:///home/linuxuser/Desktop/GParted.png
    file:///home/linuxuser/Desktop/Resize.png

    MacsandaPi
    Posts: 95
    Joined: Tue Dec 30, 2014 7:44 pm

    Re: Running Raspbian from external hard drive--"no space left"

    Sat Mar 24, 2018 8:17 pm

    Obviously, I don't know how to add attachments. The Options tab under "Post a Reply" says "You may also attach files by dragging and dropping them in the message box." That's what I did.

    User avatar
    HawaiianPi
    Posts: 5203
    Joined: Mon Apr 08, 2013 4:53 am
    Location: Aloha, Oregon USA

    Re: Running Raspbian from external hard drive--"no space left"

    Sat Mar 24, 2018 8:19 pm

    MacsandaPi wrote:
    Sat Mar 24, 2018 8:09 pm
    I bought a new microSD card and flashed the Stretch zip file to it, so I'm ready to boot the RPi2B with that and try to use GParted to resize the HDD. However, it occurred to me that I already have GParted installed on my Linux Mint machine. Could I just plug the USB HDD into the Linux Mint machine and use GParted to try to expand the HDD?
    Yes, you sure can.

    Sorry, sometimes I forget that most people don't have spare SD cards laying around (I have 6 sitting on my desk right now, and more elsewhere). But I do recommend having a spare anyway. It makes it easier to do backups or test things.
    MacsandaPi wrote:
    Sat Mar 24, 2018 8:09 pm
    The GParted.png attachment shows the window when GParted is opened. I assume I should:
    1. select /dev/sdb2 and right-click on it,
    2. select unmount,
    3. and then choose resize?
    If you are sure your USB HDD is /dev/sdb, then yes.
    MacsandaPi wrote:
    Sat Mar 24, 2018 8:09 pm
    The Resize.png attachment shows GParted's resize window. Should I change "New size" to 147908?
    You can enter the size manually, or grab the right side of the partition with the mouse and drag it all the way to the right.
    My mind is like a browser. 27 tabs are open, 9 aren't responding,
    lots of pop-ups...and where is that annoying music coming from?

    MacsandaPi
    Posts: 95
    Joined: Tue Dec 30, 2014 7:44 pm

    Re: Running Raspbian from external hard drive--"no space left"

    Sat Mar 24, 2018 9:16 pm

    HawaiianPi wrote:
    Sat Mar 24, 2018 9:36 am
    rpdom wrote:
    Sat Mar 24, 2018 4:46 am
    Because it is a bit tricky to resize a partition that is in use, (I'm not that familiar with gparted, it may be able to do it in two steps), it may be easier to boot off the SD card with the USB disk unplugged, then connect the USB disk and run gparted on /dev/sda2 from there.
    Yup, that would be the best way to do it. Use another SD card since your current one is configured to load the OS from HDD. Once you have the size sorted out, reboot from your card that loads the OS from the HDD and continue below.

    I've been quite ill for the last couple of days, so I hope I'm still on the same page here. It seems you have the SD card configured to load the rootfs from the HDD, but the SD card is not mounted as /boot so firmware and kernel updates are not being applied correctly (to the SD card). If that is correct, then we can fix that by editing the /etc/fstab file.
    The GParted resize operation said it completed successfully, so I unplugged the USB HDD from the Linux Machine and plugged the drive into the RPi2B. I put the original SD card back in the Pi and rebooted to try to start editing the /etc/fstab file as you outlined in your post above.

    The RPi won’t boot past the screen with four raspberries in the upper left corner of the screen. There are two lines below that:

    [ 4.410413] sd 0:0:0:0: [sda] No Caching mode page found
    [ 4.416032] sd 0:0:0:0: [sda] Assuming drive cache: write through

    So….what to do to get this to work? Soooo frustrating!!

    Return to “Troubleshooting”