If you are running out of hard drive space on hda1 (the location of the OS, and the default location of installed programs), you can free up space by moving some of the files to hda3 (the large partition containing the network shares). You can then create symbolic links in the original locations, and should in that way be able to access your files as if nothing happened (for the most part).

+

]]

+

__TOC__

−

You could well run into problems if you do this. There are known issues related to ho <tt>busybox</tt> uses symbolic links, and other issues might arise. Some issues are reported below, but others may not. Proceed at your own risk.

−

Note that <tt>/dev/hda3</tt> is mounted on either <tt>/mnt</tt> or <tt>/mnt/hda</tt>, depending on the type of LinkStation you have (the instructions below refer to the former. If <tt>/mnt/hda</tt> exists on your LinkStation, you will need to modify the commands accordingly.

+

==Background==

+

{{Postit|Note| there's also the alternative to increase hda1's size. You'll likely have to delete hda2&hda3 though,

+

and it's something you'll usually do before reflashing.

+

[[Upgrade (or replace) the existing LinkStation hard drive]]}}

+

If you are running out of hard drive space on '''<tt>hda1</tt>''' (the location of the OS, and the default location of installed programs), you can free up space by moving some of the files to '''<tt>hda3</tt>''' (the large partition containing the network shares). You can then create symbolic links in the original locations, and should in that way be able to access your files as if nothing happened (for the most part). You could well run into problems if you do this with '''[[OpenLink]]'''. There are known issues related to how '''[[w:BusyBox|BusyBox]]''' uses symbolic links, and other issues might arise. Some issues are reported below. ''Proceed at your own risk.''

−

==== /home ====

+

==OpenLink==

+

=== /home ===

Moving the <tt>/home</tt> directory should be safe, but it will not save you much space unless you are going to store a lot of data in the home directory of users. This can be done as follows:

Moving the <tt>/home</tt> directory should be safe, but it will not save you much space unless you are going to store a lot of data in the home directory of users. This can be done as follows:

−

cp -Rdp /home /mnt

+

DIR="$(mount | grep hda3 | awk '{print $3}')"

+

cp -Rdp /home ${DIR}

rm -R /home

rm -R /home

−

ln -s /mnt/home /home

+

ln -s ${DIR}/home /home

−

==== /usr/local ====

+

=== /usr/local ===

−

Moving the <tt>/usr/local</tt> directory should also be safe, both on OpenLink and FreeLink. This directory contains additionally installed software, and moving it should not disrupt any mission critical applications. This can be done as follows:

+

Moving the <tt>/usr/local</tt> directory should also be safe. This directory contains additionally installed software, and moving it should not disrupt any mission critical applications. This can be done as follows:

−

mkdir /mnt/usr

+

DIR="$(mount | grep hda3 | awk '{print $3}')"

−

cp -Rdp /usr/local /mnt/usr

+

mkdir ${DIR}/usr

+

cp -Rdp /usr/local ${DIR}/usr

rm -R /usr/local

rm -R /usr/local

−

ln -s /mnt/usr/local /usr/local

+

ln -s ${DIR}/usr/local /usr/local

−

==== /usr ====

+

=== /usr - Fixing the busybox symlinks ===

−

If you need more space than would be freed up by moving <tt>/usr/local</tt>, you can move the entire <tt>/usr</tt> directory instead. One reason could be that Debian(FreeLink) wants to install a lot of stuff in <tt>/usr/bin</tt>, rather than in <tt>/usr/local/bin</tt>. If you are not using busybox (FreeLink typically does not), then there ''should'' be no problems. If you ''are'' using busybox but still want to move <tt>/usr</tt>, you must fix the busybox symlinks (see below).

+

{{Warning|Although it is not reccomended to do so for '''[[OpenLink]]''', instead of moving '''<tt>/usr/local</tt>''' you can move the '''[[#.2Fusr|entire <tt>/usr</tt> directory]]''' as you would for FreeLink. But then you must fix the busybox symlinks. You should not need to do this if you follow the instructions above and only move:

'''Do not follow the instructions for moving <tt>/usr</tt> if you have already moved <tt>/usr/local</tt>'''. <br/>

+

====First method====

−

(for reasons that should be obvious to you if you're even reading this).

+

−

+

−

You can move the <tt>/usr</tt> with the following commands:

+

−

cp -Rdp /usr /mnt

+

−

rm -R /usr

+

−

ln -s /mnt/usr /usr

+

−

+

−

==== /var ====

+

−

Moving <tt>/var</tt> with openlink is strongly recommended against, as OpenLink runs it as a ramdisk, so it will be lost and recreated on each reboot. As far as is known, FreeLink does not use this ramdisk, but moving var could also be dangerous since if something goes wrong your LS may very well fail to boot as it cannot access <tt>/var</tt> for creating the pidfiles. Since <tt>/var</tt> typically does not use much disk space - why risk it?

+

−

+

−

But it's your LinkStation, so if you really want to, here's how:

+

−

cp -Rdp /var /mnt

+

−

rm -R /var

+

−

ln -s /mnt/var /var

+

−

+

−

== Fixing the busybox symlinks ==

+

This script makes the needed changes to all the busybox symlink, changing them from <tt>../../bin/busybox</tt> links to <tt>/bin/busybox</tt>. Run it with the AWK program.

This script makes the needed changes to all the busybox symlink, changing them from <tt>../../bin/busybox</tt> links to <tt>/bin/busybox</tt>. Run it with the AWK program.

Line 58:

Line 49:

}

}

−

== Alternative method ==

+

==== Alternative method ====

The following has also been suggested as a fix to the symlink problem. It is a bit more work than the above method, but might be able to resolve non-busybox-related symlink problems as well.

The following has also been suggested as a fix to the symlink problem. It is a bit more work than the above method, but might be able to resolve non-busybox-related symlink problems as well.

If you follow the FAQ to move /usr to say, <tt>/mnt/hda/moved_folder/usr</tt> and symbolic-link it back, some relative links won't work. For example, <tt>/usr/bin/wget</tt> has the symbolic link <tt>../../bin/busybox</tt>, and that would get resolved to <tt>/mnt/hda/moved_folder/bin/busybox</tt>, which does not exist. Therefore, you can link all unmoved directory under root back to this <tt>/mnt/hda/moved_folder</tt>:

If you follow the FAQ to move /usr to say, <tt>/mnt/hda/moved_folder/usr</tt> and symbolic-link it back, some relative links won't work. For example, <tt>/usr/bin/wget</tt> has the symbolic link <tt>../../bin/busybox</tt>, and that would get resolved to <tt>/mnt/hda/moved_folder/bin/busybox</tt>, which does not exist. Therefore, you can link all unmoved directory under root back to this <tt>/mnt/hda/moved_folder</tt>:

+

DIR="$(mount | grep hda3 | awk '{print $3}')"

ln -s /bin /mnt/hda/moved_folder

ln -s /bin /mnt/hda/moved_folder

−

ln -s /dev /mnt/hda/moved_folder

+

ln -s /mnt/hda/moved_folder

ln -s /etc /mnt/hda/moved_folder

ln -s /etc /mnt/hda/moved_folder

ln -s /lib /mnt/hda/moved_folder

ln -s /lib /mnt/hda/moved_folder

Line 75:

Line 67:

ln -s /tmp /mnt/hda/moved_folder

ln -s /tmp /mnt/hda/moved_folder

ln -s /www /mnt/hda/moved_folder

ln -s /www /mnt/hda/moved_folder

+

+

==FreeLink==

+

=== /home ===

+

Moving the <tt>/home</tt> directory should be safe, but it will not save you much space unless you are going to store a lot of data in the home directory of users. This can be done as follows:

+

DIR="$(mount | grep hda3 | awk '{print $3}')"

+

cp -Rdp /home ${DIR}

+

rm -R /home

+

ln -s ${DIR}/home /home

+

+

=== /usr ===

+

If you need more space than would be freed up by moving <tt>/usr/local</tt>, you can move the entire <tt>/usr</tt> directory instead. Since Debian(FreeLink) installs into <tt>/usr/bin</tt> and does not typically use busybox there ''should'' be no problems. If you ''are'' using busybox(OpenLink) but still want to move <tt>/usr</tt>, you must [[#.2Fusr_-_Fixing_the_busybox_symlinks|fix the busybox symlinks]].

+

+

You can move the <tt>/usr</tt> with the following commands:

+

DIR="$(mount | grep hda3 | awk '{print $3}')"

+

cp -Rdp /usr ${DIR}

+

rm -R /usr

+

ln -s ${DIR}/usr /usr

+

+

=== /var ===

+

Moving <tt>/var</tt> with OpenLink is strongly recommended against, as OpenLink runs it as a ramdisk, so it will be lost and recreated on each reboot. As far as is known, FreeLink does not use this ramdisk, but moving var could also be dangerous since if something goes wrong your LS may very well fail to boot as it cannot access <tt>/var</tt> for creating the pidfiles.

+

+

However, Debian does use quite a lot of space on <tt>/var</tt>, notably in <tt>/var/lib</tt> and <tt>/var/cache</tt>. Therefore, if you are running FreeLink and are installing a lot of additional software, you may need to move <tt>/var</tt> as well. This has been confirmed to work well for several FreeLink users.

+

+

If you choose to do so, these are the commands needed to move <tt>/var</tt>:

+

DIR="$(mount | grep hda3 | awk '{print $3}')"

+

cp -Rdp /var ${DIR}

+

rm -R /var

+

ln -s ${DIR}/var /var

+

+

You could also choose to move only <tt>/var/lib</tt> and <tt>/var/cache</tt>. You would of course need to modify the commands accordingly.

+

-----

+

+

=== another possibility ===

+

+

Bind-mount ''/usr'' and ''/home'' to ''/dev/hda3''! (done with freelink, there might be problems with openlink, compare to the above)

If you are running out of hard drive space on hda1 (the location of the OS, and the default location of installed programs), you can free up space by moving some of the files to hda3 (the large partition containing the network shares). You can then create symbolic links in the original locations, and should in that way be able to access your files as if nothing happened (for the most part). You could well run into problems if you do this with OpenLink. There are known issues related to how BusyBox uses symbolic links, and other issues might arise. Some issues are reported below. Proceed at your own risk.

OpenLink

/home

Moving the /home directory should be safe, but it will not save you much space unless you are going to store a lot of data in the home directory of users. This can be done as follows:

/usr/local

Moving the /usr/local directory should also be safe. This directory contains additionally installed software, and moving it should not disrupt any mission critical applications. This can be done as follows:

/usr - Fixing the busybox symlinks

WARNING!

Although it is not reccomended to do so for OpenLink, instead of moving /usr/local you can move the entire /usr directory as you would for FreeLink. But then you must fix the busybox symlinks. You should not need to do this if you follow the instructions above and only move:

Alternative method

The following has also been suggested as a fix to the symlink problem. It is a bit more work than the above method, but might be able to resolve non-busybox-related symlink problems as well.

If you follow the FAQ to move /usr to say, /mnt/hda/moved_folder/usr and symbolic-link it back, some relative links won't work. For example, /usr/bin/wget has the symbolic link ../../bin/busybox, and that would get resolved to /mnt/hda/moved_folder/bin/busybox, which does not exist. Therefore, you can link all unmoved directory under root back to this /mnt/hda/moved_folder:

/usr

If you need more space than would be freed up by moving /usr/local, you can move the entire /usr directory instead. Since Debian(FreeLink) installs into /usr/bin and does not typically use busybox there should be no problems. If you are using busybox(OpenLink) but still want to move /usr, you must fix the busybox symlinks.

/var

Moving /var with OpenLink is strongly recommended against, as OpenLink runs it as a ramdisk, so it will be lost and recreated on each reboot. As far as is known, FreeLink does not use this ramdisk, but moving var could also be dangerous since if something goes wrong your LS may very well fail to boot as it cannot access /var for creating the pidfiles.

However, Debian does use quite a lot of space on /var, notably in /var/lib and /var/cache. Therefore, if you are running FreeLink and are installing a lot of additional software, you may need to move /var as well. This has been confirmed to work well for several FreeLink users.