Difference between revisions of "Add a Storage Partition & Modify your System to Suit"

applied boxes and formatting - adding warning box
m (removed unnecessary whitespace)
(applied boxes and formatting - adding warning box)
Line 1: Line 1:
==Introduction==
==Introduction==
My storage system was OK when I initially devised it, as it happens, the years have gone by & it had become inefficient & a bit messy. So, time for a makeover.
My storage system was OK when I initially devised it, as it happens, the years have gone by & it had become inefficient & a bit messy. So, time for a makeover. So I spent some hours reorganizing my partitions - 11 -> 12 hours of GParted work. During this time I removed the /swap partition; enlarged my '''/''' partition, it still had ~2GB of free space which should have been fine for the way I use my system.  
 
So I spent some hours reorganizing my partitions - 11 -> 12 hours of GParted work. During this time I removed the /swap partition; enlarged my '''/''' partition, it still had ~2GB of free space which should have been fine for the way I use my system.  


A '''/swapfile''' [[https://wiki.manjaro.org/index.php/Swap#Using_a_Swapfile]] is to replace the /swap partition (see the previous link for the simple how-to on how to create a /swapfile). My /swapfile was located in the '''/''' partition.   
A '''/swapfile''' [[https://wiki.manjaro.org/index.php/Swap#Using_a_Swapfile]] is to replace the /swap partition (see the previous link for the simple how-to on how to create a /swapfile). My /swapfile was located in the '''/''' partition.   
Line 13: Line 11:


===The new partition layout===
===The new partition layout===
  /boot      - 102MB  ext2  (half full)
  /boot      - 102MB  ext2  (half full)
  /          - 20GB  ext4  (carries the 4GB /swapfile & still has 5GB free)
  /          - 20GB  ext4  (carries the 4GB /swapfile & still has 5GB free)
  /home      - 20GB  ext4  (12GB free)
  /home      - 20GB  ext4  (12GB free)
  /bdata    - 892GB  ext4
  /bdata    - 892GB  ext4
<br clear="all" />


==Manipulating the Partitions==
==Manipulating the Partitions==
 
{{BoxDanger|Working with partitions|Modifying an existing partition table may cause loss of data. '''Always''' ensure adequate backup to external storage}}
The GParted boot CD (based on Debian) was used to delete /swap & to modify the size of all (bar /boot) of the partitions on the 1TB (931.51GB formatted) drive. I had to, delete, shrink, move, expand, create (reboot & move my personal data across from /home to the new /bdata , then reboot GParted) shrink, expand.
Boot Manjaro from a live ISO and use Gparted to delete /swap & to modify the size of all (bar /boot) of the partitions on the 1TB (931.51GB formatted) drive. I had to, delete, shrink, move, expand, create (reboot & move my personal data across from /home to the new /bdata , then reboot GParted) shrink, expand.


As previously mentioned, this took 11 -> 12 hours. The larger the partition & the more data involved the longer it takes to process a partition.
As previously mentioned, this took 11 -> 12 hours. The larger the partition & the more data involved the longer it takes to process a partition.
''begin rant:''
''As I harp on about in the forum with partition work, finish one job then setup the next job in your partitioning software. Don't give whatever software you are using a string of jobs to do & then tell it to do them all. Your time is valuable & your data is often too valuable to run the risk of corrupting it. Sometimes it is irreplaceable for those that don't backup (baby photos for instance.) /rant''


==Modifying the system to suit these changes==
==Modifying the system to suit these changes==
I had to comment out the call for mounting the /swap partition in /etc/fstab , change the path buttons in Worker (I'm probably the only one reading this that uses the wonderful Worker, so, for all that statement is worth...) to suit the new partition layout. For anyone doing the same thing you need to think about anything that you may have done that needs to be reconfigured to use these new paths (more on this later).
I had to comment out the call for mounting the /swap partition in /etc/fstab , change the path buttons in Worker (I'm probably the only one reading this that uses the wonderful Worker, so, for all that statement is worth...) to suit the new partition layout. For anyone doing the same thing you need to think about anything that you may have done that needs to be reconfigured to use these new paths (more on this later).


Line 46: Line 37:


I Copied the UUID for the new partition into /etc/fstab & created a call for this new partition, like so:
I Copied the UUID for the new partition into /etc/fstab & created a call for this new partition, like so:
 
{{File|file=/etc/fstab|content=<pre>...
UUID=9fe95af9-529e-4f68-b83c-7fa9e7fb3ba1 /mnt/bdata ext4 defaults      0      1
UUID=9fe95af9-529e-4f68-b83c-7fa9e7fb3ba1 /data/bdata ext4 defaults      0      1
...
</pre>}}


Then as root I made the directory /mnt/bdata , so that the new partition is accessible. You can do this in the Terminal like so (replace <directory.name> with the name you want to call your new partition:
Then as root I made the directory /mnt/bdata , so that the new partition is accessible. You can do this in the Terminal like so (replace <directory.name> with the name you want to call your new partition:
 
{{RootCmd|command=mkdir -p /data<directory.name>}}
sudo mkdir /mnt/<directory.name>


Due to GParted doing its work with root permissions we need to change the ownership (owner:group) of the new partition, which we do by modifying the ownership of the directory name (that was created in the last command above) from root:root to <user.name>:users. To do that use the following Terminal command:
Due to GParted doing its work with root permissions we need to change the ownership (owner:group) of the new partition, which we do by modifying the ownership of the directory name (that was created in the last command above) from root:root to <user.name>:users. To do that use the following Terminal command:
{{RootCmd|command=chown <user.name>:users /data/<new.partition's.name>}}


sudo chown <user.name>:users  /mnt/<new.partition's.name>
<br clear="all" />
==Configure the system to use new default storage directories==
==Configure the system to use new default storage directories==


Line 64: Line 54:
{{File|
{{File|
file=~/.bash_profile|
file=~/.bash_profile|
content=
content=<pre>PATH=$PATH:/mnt/bdata/scripts
<pre>PATH=$PATH:/mnt/bdata/scripts
export PATH
export PATH
PATH=$PATH:~/games/ut2004
PATH=$PATH:~/games/ut2004
export PATH
export PATH
PATH=$PATH:~/games/ut2004/System
PATH=$PATH:~/games/ut2004/System
export PATH</pre>
export PATH</pre>}}
}}


{{File|
{{File|
file=/etc/profile|
file=/etc/profile|
content=
content=<pre># Set our default path
<pre>
# Set our default path
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/mnt/bdata/scripts:"
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/mnt/bdata/scripts:"
export PATH
export PATH</pre>}}
</pre>
}}


Then I needed to change the paths for what are considered to be the standard default /home/<user>/ storage directories - Downloads, Video, Music & so on. I had previously changed these paths, also, I don't want to use capital letters in the beginning of their names.
Then I needed to change the paths for what are considered to be the standard default /home/<user>/ storage directories - Downloads, Video, Music & so on. I had previously changed these paths, also, I don't want to use capital letters in the beginning of their names.


If you have more than one user account on your system, then it would be best to use & edit:
If you have more than one user account on your system, then it would be best to use & edit:
{{UserCmd|command=nano ~/.config/user-dirs.conf}}


~/.config/user-dirs.conf
If the above file doesn't exist, create it. Then copy mine (just below), editing it to suit your system/desires. Having only one user account on my Manjaro setup, I delete the previously mentioned file (if it existed anyway) & modify:
 
If the above file doesn't exist, create it. Then copy mine (just below), editing it to suit your system/desires.
 
Having only one user account on my Manjaro setup, I delete the previously mentioned file (if it existed anyway) & modify:


/etc/xdg/user-dirs.defaults  
{{RootCmd|command=nano /etc/xdg/user-dirs.defaults}}


As its settings, under these circumstances (not having a ~/.config/user-dirs.conf ) will be global. Mine edited file follows:
As its settings, under these circumstances (not having a ~/.config/user-dirs.conf ) will be global. Mine edited file follows:
Line 99: Line 80:
{{File|
{{File|
file=~/.config/user-dirs.conf|
file=~/.config/user-dirs.conf|
content=
content=<pre># Default settings for user directories customised by handy :->
<pre>
# Default settings for user directories customised by handy :->
#
#
# The values are relative pathnames from the home directory and
# The values are relative pathnames from the home directory and
# will be translated on a per-path-element basis into the users locale
# will be translated on a per-path-element basis into the users locale
DESKTOP=desktop
DESKTOP=desktop
DOWNLOAD=/mnt/bdata/downloads
DOWNLOAD=/data/bdata/downloads
DOCUMENTS=/mnt/bdata/documents
DOCUMENTS=/data/bdata/documents
MUSIC=/mnt/bdata/music
MUSIC=/data/bdata/music
PICTURES=/mnt/bdata/pictures
PICTURES=/data/bdata/pictures
VIDEOS=/mnt/bdata/videos
VIDEOS=/data/bdata/videos</pre>
</pre>
}}
}}


Once you have done this, check that you don't have new (likely empty) default directories in your ~/ that were created by the above file(s) on boot. Any such void files should be deleted after you have modified either the ''user'' based '''~/.config/user-dirs.conf''' or the ''root'' based '''/etc/xdg/user-dirs.defaults''' files.
Once you have done this, check that you don't have new (likely empty) default directories in your ~/ that were created by the above file(s) on boot. Any such void files should be deleted after you have modified either the ''user'' based '''~/.config/user-dirs.conf''' or the ''root'' based '''/etc/xdg/user-dirs.defaults''' files. '''~/.bashrc''' may need some paths changed as well, depending on what you call from it.
 
'''~/.bashrc''' may need some paths changed as well, depending on what you call from it.


I also had to tell qBittorent, Firefox (& the few other browsers I'm testing) where their particular download directories had moved to. Any other applications that were set to save data into the documents, or any other directory that has moved (or been created as a default, in either of the two directories above) will need to have their config's modified too. & so it goes...
I also had to tell qBittorent, Firefox (& the few other browsers I'm testing) where their particular download directories had moved to. Any other applications that were set to save data into the documents, or any other directory that has moved (or been created as a default, in either of the two directories above) will need to have their config's modified too. & so it goes...
<br clear="all" />


==Creating a /swapfile==
==Creating a /swapfile==
Now, if you do choose to not have a /swap partition but you would still like to have swap space (which of course you can choose to easily have at any time in the future), then there is a very functional option available to you called a /swapfile. For simple information on how to set one up, have a look over here: [https://wiki.manjaro.org/index.php?title=Add_a_/swapfile]
Now, if you do choose to not have a /swap partition but you would still like to have swap space (which of course you can choose to easily have at any time in the future), then there is a very functional option available to you called a /swapfile. For simple information on how to set one up, have a look over here: [https://wiki.manjaro.org/index.php?title=Add_a_/swapfile]
<br clear="all" />


=Support=
==Support==


Following is a link to this page's forum counterpart where you can post any related feedback: [https://archived.forum.manjaro.org/t/wiki-add-a-storage-partition-modify-your-system-to-suit/17665 Wiki Add a Storage Partition]
Following is a link to this page's forum counterpart(archived): [https://archived.forum.manjaro.org/t/wiki-add-a-storage-partition-modify-your-system-to-suit/17665 Wiki Add a Storage Partition]


[[Category:Contents Page]]
[[Category:Contents Page]]
Moderators, translator
455

edits