You are not logged in.

#1 2020-02-18 10:40:20

sefacs89
Member
Registered: 2019-08-12
Posts: 27

[Solved] Moving Var /etc/fstab

Hello i just recently
upgrade my system with a new SSD

i would like to move all the /var/log
from SSD to HDD

i have already achieve to mount the HDD automatically
during the boot
with this command

 
/dev/sdb1 /mnt/joal ext4 defaults,rw 0 0

how do i move the /var/log to the HDD and link it ?

thanks everyone smile

Last edited by sefacs89 (2020-02-19 10:02:37)

Offline

#2 2020-02-18 10:59:29

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,708
Website

Re: [Solved] Moving Var /etc/fstab

Well, you can copy files using cp.
After that, change the mount point of the HDD to /var, so it is being mounted at the correct place.
That is, if you really want to use the HDD as /var.
Otherwise mount the HDD wherever you want and create an appropriate var directory on it.
Then add a bind mount after the HDD mount to the fstab, which mounts this var directory to /var.


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#3 2020-02-18 11:29:51

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved] Moving Var /etc/fstab

sefacs89 wrote:

i would like to move all the /var/log
from SSD to HDD

Why?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2020-02-18 11:41:53

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [Solved] Moving Var /etc/fstab

Also: don't use /mnt for permanent mountpoints[1] and note that defaults includes the rw option. See also hier(7) & fstab(5).

[1] If you get caught doing that by the mount Police you *will* go to jail tongue


Jin, Jîyan, Azadî

Offline

#5 2020-02-18 12:14:54

sefacs89
Member
Registered: 2019-08-12
Posts: 27

Re: [Solved] Moving Var /etc/fstab

schard wrote:

Well, you can copy files using cp.
After that, change the mount point of the HDD to /var, so it is being mounted at the correct place.
That is, if you really want to use the HDD as /var.
Otherwise mount the HDD wherever you want and create an appropriate var directory on it.
Then add a bind mount after the HDD mount to the fstab, which mounts this var directory to /var.


so my line of code will be

/dev/sdb1 /var ext4 defaults,rw 0 0 

@Slithery

Why ?

caused i cant change the location of journals logs

@Head_on_a_stick
Do you think they care about mounts @ all big_smile
they use the commands some other build big_smile

Thanks everyone

Offline

#6 2020-02-18 12:18:41

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved] Moving Var /etc/fstab

I meant why do you want them on the HD instead of the SSD.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#7 2020-02-18 15:05:49

sefacs89
Member
Registered: 2019-08-12
Posts: 27

Re: [Solved] Moving Var /etc/fstab

Slithery wrote:

I meant why do you want them on the HD instead of the SSD.


to eliminate read/write cycles big_smile

as much as possible

Offline

#8 2020-02-18 15:17:37

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [Solved] Moving Var /etc/fstab

sefacs89 wrote:

to eliminate read/write cycles

You don't have to do that any more, your SSD will probably outlast the spinning rust drive: https://techreport.com/review/27909/the … -all-dead/


Jin, Jîyan, Azadî

Offline

#9 2020-02-18 15:45:13

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: [Solved] Moving Var /etc/fstab


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#10 2020-02-19 00:47:10

cirrus
Member
From: Glasgow Scotland
Registered: 2012-08-24
Posts: 341
Website

Re: [Solved] Moving Var /etc/fstab

see this wiki dd article on cloning a drive, you can clone current install onto the new SSD provided the SSD is large enough to fit all the partitions of current install.
https://wiki.archlinux.org/index.php/Dd … _hard_disk
this is only but one method there are other methods

Offline

#11 2020-02-19 10:02:21

sefacs89
Member
Registered: 2019-08-12
Posts: 27

Re: [Solved] Moving Var /etc/fstab

yo the problem
has been solved succesfully
i have move some files

thanks everyone
changing status to solved

Offline

Board footer

Powered by FluxBB