-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tutorial: Adding a swap file and moving /home to an SD card #61
Comments
I followed your instructions, and somehow messed up something. I wanted to connect through the serial port to rectify things, but I have got the following message: |
-bash: /etc/fstab: Permission denied |
@pliablepixels Nam from the coral team here, very nice guide, and thanks
Then sudo fdisk -l should show something like this:
You'll want to make
And the rest is to follow your tutorial :) For me personally, I'll just mount it to an sdcard directory without copying $HOME files over:
Cheers! |
I always get to the point where you "permanently mount it" but once i reboot the board, it doesn't mount itself, still don't know why, followed the exact steps verifying not damaging fstab, checked thrice, after reboot the file fstab keeps the modification but the SD doesn't mount itself, am I doing something wrong? |
If anyone has a similar problem, check your The partitions are mounted in the order they appear in /dev/mmcblk0p4 / ext4 noatime,defaults 0 1
/dev/mmcblk0p1 /boot ext2 noatime,defaults 0 2
tmpfs /var/log tmpfs defaults 0 0
# sd card
/dev/mmcblk1p1 /home ext4 defaults 0 1
# default
/dev/mmcblk0p3 /home ext4 noatime,nosuid,nodev,defaults 0 3 Leave the original mount entry in the config file in case something goes wrong. |
Is there any way I can merge /dev/mmcblk0p3 with /dev/mmcblk0p4 ? |
@Sruthi-sk Please open a new issue. |
Issue TitleUnable to Mount New Partition to /home Directory Issue DescriptionI attempted to add a new partition to the Steps to Reproduce
Expected BehaviorThe new partition Actual BehaviorThe
Possible Suggested FixModification for
Is it supposed to work? |
I thought it might be useful to document the steps to resolve #5 and #6. I'm not an embedded person by any means, so feel free to correct/suggest improvements:
Here is what I did - I added a 128GB micro SD card to the coral board and wanted to do the following:
a) Migrate my existing
/home
to my sd cardb) Set up a 1G swap file, but set a low swapiness value, so its only used when really needed
Caveats:
a) Migrating
/home
and swap to an SD card may reduce the lifespan of the card. Thus it is important to make sure the swap file is only used when really needed. I'm personally not convinced that moving/home
to an SD card is bad, but who knows. Don't do it if you don't want to :-)Start:
I assume you have followed the "Getting Started" instructions and are now at a point where you can successfully
mdt shell
into your device and can run the demos the page shows (nice demos).Steps:
Insert SD card
Now get ID of SD card
So in my case, the SD card is
/dev/mmcblk1
Now wait a while while it formats.
Reboot your machine from an mdt shell and make sure your home directory is all good. Note if you are unable to
mdt shell
you did something wrong. In my case, I forgot to change permissions of the copied directory tomendel
and also mistakenly moved/home
to/home/home
in my SD card with the first rsync command. Worry not, you can always use your serial connector and connect to the coral board - you can login withmendel/mendel
and rectify things.Assuming now your home directory is migrated and you have validated running the demos etc, lets set up Swap
This sets up a bounded 2G file on your SD card
Make sure its set up correctly:
Yup.
Now make it permanent
Now make sure you set a low swappiness to the system doesn't use it aggressively
Edit your
/etc/sysctl.conf
and add:to the file, if it doesn't already exists. If that value exists, change it to
10
This is my system after all of that and a fresh reboot
The text was updated successfully, but these errors were encountered: