I tried above procedure, and it was NOT working.
So, what I did:
- Backup MBR with: dd if=/dev/sda of=/www/mbl.mbr bs=512 count=1
- Upgrade with original sysupgrade
- Restore MBR with: dd if=mbl.mbr of=/dev/sda bs=512 count=1
I tried above procedure, and it was NOT working.
So, what I did:
"cat /proc/crypto",
I see new: "driver : jitterentropy_rng"
Is this where "/dev/hwrng" came from?
I also see new : "driver : gcm-aes-ppc4xx"
Why I don't see improvement of "openssl speed -elapsed -evp aes-128-gcm" result compared with previous 17.04?
That's not the MBL's fault. Unlike dm_crypt or ipsec where you will find that hardware acceleration is present, OpenSSL 1.0.x does not directly make use of hardware acceleration. As I understand, the move to 1.1 is underway but still an ongoing process because between 1.0 and 1.1 the API changed significantly, which in turn requires changes to a lot of packages.
You could compile and install a version of libopenssl with hardware crypto support through cryptodev if you are so inclined. I never tried that, though.
to add to @takimata post: The crypto offload hardware was designed with ipsec in mind. Hence there is no native support for the XTS scheme (disk- / partition- / file-encryption). In order to really utilize the hardware crypto, one would need to setup strongswan and select the Suite B cipher there (both aes-ctr and aes-gcm should work).
Last time I checked Openvpn (~2.4.3-ish) it was not a good choice. it does not batch incoming and outgoing frames together, so the hardware crypto is left dealing with individual frames at a time, which is very sub-optimal for this particular hardware.
EDIT: (oops sorry forgot about this)
No, the hardware crypto engine in this device has a "true random number generator" (and this is were the data from /dev/hwrng is coming from). There are no details on how it works exactly, though. So if you are worried you can stick with jitterentropy_rng.
I updated the file, I added DLNA now, and it works fine (just added one directory with about 100 mp4 and 100 jpg files and no problems so far)
Link: https://gist.github.com/braian87b/84802005e61f7080620b2d522b804f0d
Hello everybody,
I don't know if my question should be in this thread or if I need to open a new conversation. So, my apologies, if I mess.
I have some trouble with OpenWrt installation on MBL single :
After having installed the firmware 18.06.01 (release : r7258--5eb055306f) (and picked a few packages), I wanted to use the whole hard disk size (1TB) for OpenWrt, instead of having unused space.
I then used GParted to remove the unused space between first and secund partition and extend the secund one to occupy all the available space. Result : despite a strange warning from GParted, the job was achieved.
So now, when I list the partitions (using cfdisk), this is what I get :
Disk: /dev/sda
Size: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Label: dos, identifier: 0x4e54ab1b
Device Boot Start End Sectors Size Id Type
>> Free space 2048 8191 6144 3M
/dev/sda1 * 8192 32767 24576 12M 83 Linux
/dev/sda2 32768 1953523711 1953490944 931.5G 83 Linux
But on the other hand, when I use df this is what I get :
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 258016 42716 210060 17% /
tmpfs 127064 37916 89148 30% /tmp
/dev/sda1 12275 3120 8542 27% /boot
tmpfs 512 0 512 0% /dev
That is, nothing changed : I'm still stuck with the same disk space amount I had at the beginning.
So first question : is this the normal, expected, behaviour or have I done something wrong ?
Secund : if this is "normal", then how can I make OpenWrt use the whole disk space amount ?
Thanks
P.S. : btw, thanks @chunkeey and @takimata for the sleepoff.sh script, it's a must-have !!!
Seriously, don't do that, don't modify the default partitions. You'll gain a few megabytes at best, but you'll (at the very least) break sysupgrade.
Just create a new, additional partition after the last default one (starting at sector 557056 up to the end of your disk), format and mount it as you wish.
Also, you don't need to convert a disk <= 2 TB to GPT, regular MBR using fdisk will do.
Thanks @takimata for your reply,
Just create a new, additional partition after the last default one (starting at sector 557056 up to the end of your disk), format and mount it as you wish.
so I'll make a new fresh install, but I don't know what partitioning scheme would fit for my need. Since I'll devote one for user data (i.e. /home partition), how should I use the remaining one ? Coming from a mainstream linux background, I've always partitioned my disk as follows :
And I've never had a shortage when installing whatever packages. So what should I do, in order to generously add OpenWrt packages, without fearing space shortage ? Should I create a /usr partition ?
It seems to me that, bottom line, the question sums up to "Where do OpenWrt's packages install their apps ?"
In /usr/local ? In /opt ?
Regards.
As long as you leave the default partitions alone, you can create as many additional partitions as you like, mount them wherever you like, and use them however you like.
The default root partition is ~256 MB, and practically all of that is free space. That might not sound like much for a full-blown Linux installation, but in OpenWrt terms that is very generous and can take a lot of packages, even larger ones. Keep in mind that OpenWrt and its packages are very much geared towards embedded systems with extremely limited flash space.
I observe that most packages install their binaries to /usr/sbin
, with the configuration files at /etc
and OpenWrt/UCI specific configurations at /etc/config
.
The default root file system comes with ~ 256 MB space. It might not be for full-blown Linux installations, but in OpenWrt terms that is very
generous. Keep in mind that OpenWrt is geared towards embedded systems, many of which come with 16 MB of flash, and oftentimes less.
Ok, Takimata, I understand that I must "think in OpenWrt". I was seeing it as an headless server (which it is), but it's more than that : it's an headless server for very extreme configs.
So I'll will keep it lean and mean (or small and simple ).
Just one last question regarding the partitioning concern : do you think that allocating a partition to /swap makes sense at all ?
I'm not sure if I'm qualified to answer that. Up until now I have only used my MBLs as rather lean file servers, and I have never been in the situation where the 256 MB of RAM on the MBL was even close to being a constraint.
But of course that very much depends on what you want to run on it. I guess you could put a small partition somewhere in your partition layout, something like 256 or 512 MB, just as a precaution should you ever need a swap partition.
Just as an update to not have this thread with outdated or potentially dangerous information, for anyone who goes down this path:
"Hybrid MBR" is not a viable workaround anymore. With current snapshots, on GPT disks, sysupgrading always resets the MBR to the default two partitions and leaves a "damaged" GPT. You will always have to use gdisk
, when prompted which table to use tell it to use the GPT table (option 2), confirm and write it to disk (w), and reboot.
Can anyone tell me if its possible and can we keep the data directory if we upgrade from a running system of [https://downloads.openwrt.org/releases/18.06.5/targets/apm821xx/sata/openwrt-18.06.5-apm821xx-sata-wd_mybooklive-duo-ext4-rootfs.img.gz] (ext4 based image) to a new [https://downloads.openwrt.org/releases/19.07.0-rc1/targets/apm821xx/sata/openwrt-19.07.0-rc1-apm821xx-sata-wd_mybooklive-squashfs-sysupgrade.img.gz] (squashfs based one)?
Can anyone tell me if its possible and can we keep the data directory if we upgrade from a running system
That depends on what your "data directory" is. If it is, as recommended, an additional partition you mounted into the file system you should be fine as long as you take the necessary precautions. See https://openwrt.org/toh/wd/mybooklive#upgrading
If you, against all recommendations, enlarged the rootfs partition then ... no.
Thank you for your prompt reply
"Data" directory is within /dev/sda3 partition
Will it survive sysupgrade from 18.04 EXT4 to 19.07 SQUASHFS?
root@MBL:~# fdisk -l /dev/sda
Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x5452574f
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 8192 24575 16384 8M 83 Linux
/dev/sda2 32768 557055 524288 256M 83 Linux
/dev/sda3 557056 3907029167 3906472112 1.8T 83 Linux
root@MBL:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 252.0M 20.1M 226.8M 8% /
tmpfs 124.1M 1.2M 122.9M 1% /tmp
/dev/sda1 8.0M 3.1M 4.5M 40% /boot
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sda3 1.8T 1.1T 584.0G 66% /mnt/Data
SUCCESS!
I have just upgraded 18.04 EXT4 to 19.07 SQUASHFS. The system survived!
The current filesystem structure is:
root@MBL:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 2.8M 2.8M 0 100% /rom
tmpfs 123.9M 656.0K 123.2M 1% /tmp
/dev/loop0 251.4M 18.9M 162.5M 10% /overlay
overlayfs:/overlay 251.4M 18.9M 162.5M 10% /
/dev/sda1 8.0M 3.2M 4.3M 43% /boot
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sda3 1.8T 1.1T 584.0G 66% /mnt/Data
Hooray, and ... interesting. So the default rootfs is still 256 MB in 19.07. I guess the change that reduces it to 128 MB (and then makes it necessary to recreate additional partitions) did not make it into 19.07, only into snapshots.
So, how do I get it to shutdown instead of reboot?
I've ran Gdisk and entered 1 (MBR) after the initial flash and when I run 'halt' or 'poweroff' the hard drive spins down and the LED turns blue, then starts up again.
I printed this output before I took off the WD stock image.
MyBookLive:/sbin# parted -l
Model: ATA WDC WD30EFRX-68A (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
3 15.7MB 528MB 513MB linux-swap(v1) primary
1 528MB 2576MB 2048MB ext3 primary raid
2 2576MB 4624MB 2048MB ext3 primary raid
4 4624MB 3001GB 2996GB ext4 primary
Model: Unknown (unknown)
Disk /dev/md1: 2048MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 2048MB 2048MB ext3
MyBookLive:/sbin# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
md1 : active raid1 sda2[1] sda1[0]
1999808 blocks [2/2] [UU]
So, how do I get it to shutdown instead of reboot?
See the There was a solution-of-sorts in an older thread on exactly this issue [edit] that is no longer working, see below.
I printed this output before I took off the WD stock image.
What are you trying to do with that? The stock image (a heavily customized Debian) is massively outdated and comes with a completely different partition setup.
Okay. Can you please help me get this image on my My Book Live? I tried for the past few days with no luck and got so frustrated that I put the stock image back on. Besides of more security updates, what advantages does this image have compared to the stock image? I'd be more than happy to put an old LEDE/OpenWRT image and call it a day.