NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

No free disk space on CVS-1458RT after cloning Linux from Github

Hi,

I'm trying to get a touchscreen with an Egalax controller to work with my linux rt 3.10.31 on a NI CVS-1458RT. So I followed the steps in post #36 in this thread: https://decibel.ni.com/content/thread/40916?start=30&tstart=0 . I had to configure my git to work with our company firewall and could then clone the squashfs-tools to my RT target. After I started the clone of linux (point #13.) the files were downloaded to my target and at some point it just run out of space ("df" command shows only 1,6GB space on /dev/root). So I ereased the folder "Documentaion" in /media/linux as I think that the last downloaded files were stored at this place (~1GB of data). But after deleting this folder as an admin there was no free space released. So I tried just to format the target with the VBAI but I can not get any working connection with my RT target. VBAI lists my target but when I try to configure (format) it VBAI displays that it failures to connect to the remote target. NI MAX doesnt even list my target so I have no chance to reset it to factory defaults.

In Safe OP Mode VBAI can at least get a connection to my target an recognises it in SAFE OP MODE, but then VBAI starts to format the target I get again the error, that it can not connect to the remote target. What can I do to set my target at least back to factory defaults?

Thank you for your support.

0 Kudos
Message 1 of 7
(4,555 Views)

I solved my problem by searching for the big file that has been downloaded by git into an hidden folder und removing it. The commands "du" "ls -a" were very helpful. After getting some space on the disk I could reset my RT Target back to it's factory defaults.

0 Kudos
Message 2 of 7
(3,957 Views)

Comment on the Re: Touchscreen Usage Discussion?

Where where you cloning the linux repo to on your target? Note that if you were using something in the /var/volatile directory (this includes /tmp), that would explain why you ran out of disk space (you filled up the ramdisk that is used for /var/volatile). This would also impact SysApi (used by VBAI, from my understanding) being able to do things to your target.

0 Kudos
Message 3 of 7
(3,957 Views)

Hi Brad,

As I said I followed your instructions and the sqashfs-tools were installed at /sqashfs-tools. After point #11 I went to the "highest" directory (sorry I have not much experience with linux) and executed the command "git clone ... /linux". After I ran out of disk space I searched for the downloaded files and as much as I remember they were stored in /usr/lib/git/documentation or /usr/lib/git/linux (can't remember which path it exactly was).

Do you know how much data (MB/GB) has to be downloaded? I can't imagine that 1GB of free disk space is not enough for building the new kernel. To get this done I'm now cloning the repository to a USB flash drive. Does it matter, where the files are stored and which file system is on the flash drive?

Thank you for your support

Edit: I tried to clone the Linux repository to a USB flash drive and failed. About 1GB of Data was downloaded and the command "git clone git://github.com/ni/linux ." was executed  succesfully. If I try to checkout my branch (nilrt_pub/14.0/3.10) i get the error message: "fatal: Unable to create '/media/sdb1/aaa/.git/index.lock' : File exists. ...". I lost about 1,2GB of free disk space on the flash drive but the directory to which the repository was downloaded to ("aaa") is only 14,5kb (3909 files). Also the folder "aaa" contains only empty files. Do I have to disable hardlinks because the file system on the flash drive is FAT32?

Edit 2: I solved the cloning problem by using the "git clone --no-hardlinks https://github.com/ni/linux ." command in the USB flash drive directory. The command was executed successfully and now the files were stored as expected and they are no longe empty. Of course I got the next error.

When trying to checkout my version (nirlt_pub/14.0/3.10) git founds two local changes: "flashdrive_xyz/net/netfilter/xt_TCPMSS.c" and "tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-HP". As I haven't changeg any files since the cloning I don't understand this message. To fix this "error" I tried to reset my repository with "git reset --hard HEAD" and "git pull". But "git pull" tells me that everything is "already up-to-date."

"git status" returns this:

# Changes not staged for commit:

#     modified:     include/uapi/linux/netfilter/xt_CONNMARK.h

...

...

#     modified:     tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-HP

Or should I download the needed branch (nilrt_pub/14.0/3.10) manually and execute the steps after step # 14?

Edit 3: git problem solved by using the "git checkout --force nilrt_pub/14.0/3.10" command. Kernel in now being build. I'm still curious why git found changed files. Maybe it's better to download the needed branch instead of using git?

0 Kudos
Message 4 of 7
(3,957 Views)

Hi Andreas,

Your previous post is kinda all over the place, but let's start from the start:

  1. When cloning down sourcecode, avoid cloning down on the fairly small ramdisk (/tmp, /var/volatle, /var/tmp, etc.) and avoid non-symlink/hardlink/permissions/case-sensitive filesystems (in other words, avoid FAT12, FAT16, and FAT32). I would recommend using a directory on your admin user's home directory.
    • Login through either the serial console or ssh as admin
    • cd                                // This will get you back to the current user's home directory
    • df .                               // This will show you how much disk space exists on the disk that provides the current directory
    • git clone $REPO_URL 
    • ...
  2. The CVS 1458RT has 32GB of storage, that is plenty for the linux kernel (approximately 2GB) and squashfs-tools (less than 3MB)
  3. I'm not quite sure why git was noting that there were modifications to the files, but generally I recommend using a filesystem other than FAT32.

I'm still curious as to where the cloned repositories ended up, what directory were you in when you ran the commands?

0 Kudos
Message 5 of 7
(3,957 Views)

Hi Brad,

thank you for your answers.

1. Yes, I think too that FAT32 and the hardlinks caused the problem with the empty files on my usb flash drive. But I can not change the file system on the flash drive and the problem was solved by forcing "no-hardlinks".

I checked for free disk space on my CVS1458RT and found only 1,7GB (1GB free) with "df ." in /home/lvuser or in /home/admin or in /home/root .

"df" outputs this:

                         1K-Blocks        USED            Available         USE%          Mounted on

/dev/root           1660512          544560          1013552          35                /

devtmpfs          1965376          4                    1965372          1%               /dev

tmpfs                1967324          584                1966740          1%               /var/volatile

tmpfs                1967324          0                    1967324          0%               /media/ram

/dev/sda2          170439           40751            117073            26%             /boot

/dev/sda3          13847             1235              11537              10%             /etc/natinst/share

/dev/sdb1          3831132         1837360        1993772          48%             /media/sdb1               (flash drive)

2. The Device Specifications of the CVS-1458RT lists only 2GB of nonvolatile memory. Or did I misunterstood this data sheet?

I was in the directory above the /home directory when I startet the cloning of the linux source files.

Now I managed to clone the files to a USB flash drive and I'm compiling the kernel. But because some header files have the same name (i.e. source_files/include/uapi/linux/netfilter/xt_CONNMARK.h and xt_connmark.h) one file overwrites the other file and I get errors while compiling the kernel. Now I'm trying to fix this by editing the missing code into the header files.

0 Kudos
Message 6 of 7
(3,957 Views)

Hmm, I must have been looking at the specifications for the non-RT version of the controller or a different controller, but I see you are right and that little storage would pose an issue.

As such, there are two options you have: either limit the code history pulled down, using something like the following command

git clone --depth 1 --branch nilrt_pub/14.0/3.10 --single-branch git://github.com/ni/linux

Or, and I would actually recommend this one, formatting the flash drive to use a Linux native filesystem that supports hardlinks and is case-sensitive. This will wipe all of the data on the drive and make it unreadable on Window (until you reformat the drive from Windows to be FAT32 or NTFS)

//Unmount the drive to prepare to format

umount /media/sdb1

// Use sfdisk to change the partition type to be 83, Linux

sfdisk --change-id /dev/sdb 1 83

// Format the partition with the EXT4 filesystem

mkfs.ext4 /dev/sdb1

0 Kudos
Message 7 of 7
(3,957 Views)