fdisk on ssh?

  • I need reformat and are disk for my nas, and I have how-to, where fdisk and other orders:Source: WDMyCloud – Google Drive
    Mirror: WDMyCloud

    =======================================================================================

    Howto replace or restore original firmware:

    * You can use any of *nix system. I use Debian (Ubuntu similar).
    * All command runing from root user. Or use Sudo.
    * First thing after boot in liveCD - install software: apt-get update && apt-get install mdadm parted

    !! For install new HDD - go from p.1. If you repare exist HDD - go to p.8-2

    1. Use fdisk -l (or parted -l) for see what name have you WD's HDD.
    * For me - its /dev/sdb. Replace it to your hdd name!
    2. Run parted utility:
    parted /dev/sdb

    3. Type "print" for see what partitions exist on disk
    4. Remove all: Type "remove 1" (where 1 - number of partition)
    5. Crete new table:
    mklabel gpt
    mkpart primary 528M 2576M
    mkpart primary 2576M 4624M
    mkpart primary 16M 528M
    mkpart primary 4828M 100%
    mkpart primary 4624M 4724M
    mkpart primary 4724M 4824M
    mkpart primary 4824M 4826M
    mkpart primary 4826M 4828M
    set 1 raid on
    set 2 raid on

    6. Ok, type "quit"

    7. Format data partition:
    mkfs -t ext4 /dev/sdb4
    mkswap /dev/sda3

    8. Stop automatically loaded md raid (If need) and create new, normal (You can get errors "Not found". Its normal):
    mdadm --stop /dev/md*
    mdadm -A /dev/md0 /dev/sdb1 /dev/sdb2
    mdadm --create /dev/md0 --level=1 --metadata=0.9 --raid-devices=2 /dev/sdb1 /dev/sdb2
    # Type "watch cat /proc/mdstat" and wait 100%. Then - [ctrl] + [c] for close.

    9. Use data partition as download folder:
    mount -t ext4 /dev/sdb4 /mnt
    cd /mnt

    10. Download one of arhive's to /mnt folder:
    v3.04.01-230: 0B_6OlQ_H0PxVQ2l5MTNvQk1xSUU
    v4.01.02-417: 0B_6OlQ_H0PxVcENERjVxVHFzZzg

    11. Extract by console:
    tar xvfz original_v3.04.01-230.tar.gz

    12. Ok. Upload backup images to WD's hdd:
    dd if=kernel.img of=/dev/sdb5
    dd if=kernel.img of=/dev/sdb6
    dd if=config.img of=/dev/sdb7
    dd if=config.img of=/dev/sdb8
    dd if=rootfs.img of=/dev/md0

    13. Tell device to Fresh install (Fix for "0 MB usage" in webgui)
    mkdir /mnt/hdd
    mount /dev/md0 /mnt/hdd
    touch /mnt/hdd/etc/.fresh_install
    umount /mnt/hdd

    14. Shutdown PC. (Or use "Logout" in menu)
    shutdown -p -H 0

    15. Connect HDD to WD's plate and turn on WDMyCloud. Wait ~5-10 minCan I make it with s905?

  • You can use "parted" but if you are trying to replicate the ^^ list of commands above you will have a problem with RAID as we [deliberately] do not have any support for software RAID in the OS so mdadm commands will fail. Use an Ubuntu LiveUSB instead of LE for tasks like this. You would be better off posting in a WD/NAS forum as fixing these things is outside our area of expertise.


  • You can use "parted" but if you are trying to replicate the ^^ list of commands above you will have a problem with RAID as we [deliberately] do not have any support for software RAID in the OS so mdadm commands will fail. Use an Ubuntu LiveUSB instead of LE for tasks like this. You would be better off posting in a WD/NAS forum as fixing these things is outside our area of expertise.

    Thanks
    Then I make Ubuntu live on pc.
    Just ask why isn't work fdisk, and I expected this is comfortable with s905.
    For minimx I heard from Ubuntu release
    MiniMX S905 - Ubuntu 16.04 64bits (with kodi and X) on sdcard - FreakTab.com
    With this work?

    Edited once, last by envagyok (November 6, 2016 at 12:44 PM).