View previous topic :: View next topic |
Author |
Message |
paul_chany Tux's lil' helper
Joined: 01 Aug 2010 Posts: 82 Location: Europe, Serbia
|
Posted: Sat Apr 06, 2019 5:34 pm Post subject: |
|
|
NeddySeagoon wrote: | paul_chany,
swclock is a service, a bit like hwclock, except that it does not set system time from a hardware real time clock.
The Pi doesn't have one unless you add it yourself.
swclock saves the time at shutdown in a file and restores it at boot. This does not keep time correctly but it ensures that time never steps backwards.
Code: | $ rc-update show -v | should list both hwclock and swclock. You must only use one.
Add the one you want to use to the boot runlevel as the clock must be set before networking is started. |
In the output of command
Code: | $ rc-update show -v |
I see hwclock without any level, but
swclock with boot level added.
So my system uses swclock.
Indeed, after a reboot the command gives the right date and time.
Still have no route on my system out there.
gives
ping: gentoo.org: Temporary failure in name resolution
and gives empty output. How can I solve this problem? _________________ Best, Pali |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54605 Location: 56N 3W
|
Posted: Sat Apr 06, 2019 5:47 pm Post subject: |
|
|
paul_chany,
What does show?
It should list the interfaces eth0 and lo.
That shows that your kernel is correct.
As a test, do that should make your network work.
It will only last a few hours, until your network lease expires.
If you don't have dhcpcd, then busybox can do it. Its called udhcpc there.
Code: | busybox udhcpc eth0 |
If that's all good, the next step is to automate it, so eth0 starts at boot. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
paul_chany Tux's lil' helper
Joined: 01 Aug 2010 Posts: 82 Location: Europe, Serbia
|
Posted: Sat Apr 06, 2019 7:41 pm Post subject: |
|
|
NeddySeagoon wrote: | paul_chany,
What does show?
It should list the interfaces eth0 and lo.
That shows that your kernel is correct.
As a test, do that should make your network work.
It will only last a few hours, until your network lease expires.
If you don't have dhcpcd, then busybox can do it. Its called udhcpc there.
Code: | busybox udhcpc eth0 |
If that's all good, the next step is to automate it, so eth0 starts at boot. |
shows eth0 out there.
I have not command.
After I start Code: | busybox udhcpc eth0 | it loops forever - at least so far - with output:
udhcpc: sending discover
for more than half an hour. Is this normal? _________________ Best, Pali |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54605 Location: 56N 3W
|
Posted: Sat Apr 06, 2019 8:21 pm Post subject: |
|
|
paul_chany,
No that's not normal.
Lets get dhcpcd. On the Pi, run
It will list the files that you need to fetch, once per mirror in your GENTOO_MIRRORS list.
You need each different file only once.
Move the SDCard to your PC and fetch the files to /usr/prortage/distfiles on the SDCard.
You may already tave the files in the PCs /usr/portage/distfiles.
Move the card back to the Pi. That's called Sneakernet
With the required files in /usr/portage/distfiles, emerge has nothing to fetch, so will run on the Pi.
Now try
Silly question ... the network cable was connected both ends?
-- Edit --
Make has a feature where it checks that generated files are newer than source files.
Make loops until the check passes. On a Pi with the clock set to 1 Jan 1970, that would take 49 years.
Be sure your time is right on the Pi before you run emerge. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
paul_chany Tux's lil' helper
Joined: 01 Aug 2010 Posts: 82 Location: Europe, Serbia
|
Posted: Sun Apr 07, 2019 7:12 am Post subject: |
|
|
NeddySeagoon wrote: | paul_chany,
No that's not normal.
Lets get dhcpcd. On the Pi, run
It will list the files that you need to fetch, once per mirror in your GENTOO_MIRRORS list.
You need each different file only once.
Move the SDCard to your PC and fetch the files to /usr/prortage/distfiles on the SDCard.
You may already tave the files in the PCs /usr/portage/distfiles.
Move the card back to the Pi. That's called Sneakernet
With the required files in /usr/portage/distfiles, emerge has nothing to fetch, so will run on the Pi.
Now try
Silly question ... the network cable was connected both ends?
-- Edit --
Make has a feature where it checks that generated files are newer than source files.
Make loops until the check passes. On a Pi with the clock set to 1 Jan 1970, that would take 49 years.
Be sure your time is right on the Pi before you run emerge. |
I did as you adviced me.
Now I have dhcpcd command on my Pi 2.
I did run and the output is this:
DUID (some numbers, like 00:01: etc.)
eth0: IAID (probably a MAC address)
eth0: soliciting a DHCP lease
eth0: soliciting an IPv6 router
eth0: probing for an IPv4LL address
eth0: using IPv4LL address (169.254.57.95)
eth0: adding route to 169.254.0.0/16
eth0: adding default route
forked to background, child pid (a number)
The question is right. Yes, the network cable was connected both ends.
Now I tried out the command, but get:
ping: gentoo.org: Temporary failure in name resolution
Then I tried out the command (which is IP address of gentoo.org) but get:
PING 89.16.167.134 (89.16.167.134) 56(84) bytes of data.
From 169.254.57.95 icmp_seq=1 Destination Host Unreachable
From 169.254.57.95 icmp_seq=2 Destination Host Unreachable
From 169.254.57.95 icmp_seq=3 Destination Host Unreachable
etc. etc.
I also run Code: | rc-update add dhcpcd default | on my Pi 2.
When I run on my laptop which is on the same Network as my Pi 2, I get this:
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 95.85.167.254 0.0.0.0 UG 100 0 0 enp2s0f0
95.85.160.0 0.0.0.0 255.255.248.0 U 100 0 0 enp2s0f0
So maybe should add this route to Pi 2 too?
Edit: I solve the problem!
I power off my Internet Router for 5 minutes, then power on it again.
Then I power on Pi 2 and dhcpcd work as expected.
Now I have only one question left behind. How do I back up my Pi 2? _________________ Best, Pali |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54605 Location: 56N 3W
|
Posted: Sun Apr 07, 2019 11:28 am Post subject: |
|
|
paul_chany,
Unlike your PC, the Pi has everything needed to backup and restore in the file systems.
There is nothing in unused space outside of any filesystem.
This means you can put the Pi SD card into your PC, Mount the partitions all read only, at say, /mnt/gentoo then copy all the files.
cp -a, rsync or tar all work. Do not use dd. It copies all the empty space too and can only be restored to the same size SD card.
The read only mount is important. Copying the wrong way can remove all the files on the SD card, so it protects you against yourself.
How you restore depends on how you back up. You should practice the restore before you actually need to do it. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
paul_chany Tux's lil' helper
Joined: 01 Aug 2010 Posts: 82 Location: Europe, Serbia
|
Posted: Sun Apr 07, 2019 1:06 pm Post subject: |
|
|
NeddySeagoon wrote: | paul_chany,
Unlike your PC, the Pi has everything needed to backup and restore in the file systems.
There is nothing in unused space outside of any filesystem.
This means you can put the Pi SD card into your PC, Mount the partitions all read only, at say, /mnt/gentoo then copy all the files.
cp -a, rsync or tar all work. Do not use dd. It copies all the empty space too and can only be restored to the same size SD card.
The read only mount is important. Copying the wrong way can remove all the files on the SD card, so it protects you against yourself.
How you restore depends on how you back up. You should practice the restore before you actually need to do it. |
I did followings:
Halt the Pi 2 Model, and pull out from it SD card #1.
Put the SD card #1 into my laptop ( Gentoo linux system ).
Create a directory /mnt/malnaPi2/ on laptop.
It's permissions are:
Code: | stat /mnt/malnaPi2/ |
File: /mnt/malnaPi2/
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 813h/2067d Inode: 2 Links: 20
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2019-04-07 08:45:00.266389491 +0200
Modify: 2017-05-23 19:08:18.574855247 +0200
Change: 2017-05-23 19:08:18.574855247 +0200
Birth: -
Mount it readonly:
Code: | mount -o ro /dev/sdb3 /mnt/malnaPi2/ |
Create the BiztonsagiMentes/ directory on laptop, and change directory to it:
Code: | cd BiztonsagiMentes/ |
Rsync the SD card #1 into this directory:
Code: | rsync /mnt/malnaPi2/ . |
Backup done.
Edit:
Umount SD card #1:
Code: | umount /mnt/malnaPi2/ |
Put the SD card #1 back into Pi 2 Model.
Now in this case how to restore SD card #1 if a problem will occure? _________________ Best, Pali |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54605 Location: 56N 3W
|
Posted: Sun Apr 07, 2019 2:09 pm Post subject: |
|
|
paul_chany,
That does not backup /boot.
Code: | mount -o ro /dev/sdb3 /mnt/malnaPi2/
mount -o ro /dev/sdb1 /mnt/malnaPi2/boot | is required to backup everything.
/boot contains your kernel(s) and root contains the matching /lib/modules/*
You will need both to restore your Pi.
Restore is the opposite. Take a new SD card.
Make partitions and filesystems on it.
Mount the partitions, (without the -o ro)
Copy the files the other way.
I knew I would regret mentioning rsync, as its one I would not use.
Its essential to preserve permissions across the backup/restore.
cp -a does it automatically. tar needs the -p option, I don't know how its done with rsync. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
paul_chany Tux's lil' helper
Joined: 01 Aug 2010 Posts: 82 Location: Europe, Serbia
|
Posted: Sun Apr 07, 2019 4:49 pm Post subject: |
|
|
NeddySeagoon wrote: | paul_chany,
That does not backup /boot.
Code: | mount -o ro /dev/sdb3 /mnt/malnaPi2/
mount -o ro /dev/sdb1 /mnt/malnaPi2/boot | is required to backup everything.
/boot contains your kernel(s) and root contains the matching /lib/modules/*
You will need both to restore your Pi.
Restore is the opposite. Take a new SD card.
Make partitions and filesystems on it.
Mount the partitions, (without the -o ro)
Copy the files the other way.
I knew I would regret mentioning rsync, as its one I would not use.
Its essential to preserve permissions across the backup/restore.
cp -a does it automatically. tar needs the -p option, I don't know how its done with rsync. |
I did a backup again, but now both /boot and /root partitions are involved. _________________ Best, Pali |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|