Linux.com

bingrenling

bingrenling

  • Linux.com Member
  • Posts: 7
  • Member Since: 13 Jan
  • Last Logged In: 29 Jun

Latest Posts

Posted by
Topic
Post Preview
Posted
  • bingrenling
    RE: Is there a way to create a disk image of my whole system?
    It can take a long time. The compression ratio will depend upon the data. You could use rsync if you just need data backup. That would be faster, but disk images can take a considerable amount of time.
    Link to this post 22 Jun

    It can take a long time. The compression ratio will depend upon the data.

    You could use rsync if you just need data backup. That would be faster, but disk images can take a considerable amount of time.

  • bingrenling
    RE: Is there a way to create a disk image of my whole system?
    Hello, There is indeed. I have a blog post about the tool required here: http://elevenislouder.co/manual-backups-in-linux-dd/ However, on any linux/unix system the command would be: dd if=/dev/sdX of=/mount/point/disk.img Now, on most systems, the main disk would be sda, so the command would be dd if=/dev/sda of=/mount/point/disk.img Assuming that you only have one internal hard disk and you want the image to be backed up to an external hard disk and it was auto detected and mount at /media/disk : dd if=/dev/sda of=/media/disk/disk-image.img EDIT: to save on disk space-- dd if=/dev/sda bs=64k conv=noerror,sync | gzip -c -9 | dd of=/media/disk/disk-image.img.gz
    Link to this post 21 Jun

    Hello,

    There is indeed.

    I have a blog post about the tool required here:
    http://elevenislouder.co/manual-backups-in-linux-dd/

    However, on any linux/unix system the command would be:
    dd if=/dev/sdX of=/mount/point/disk.img

    Now, on most systems, the main disk would be sda, so the command would be dd if=/dev/sda of=/mount/point/disk.img

    Assuming that you only have one internal hard disk and you want the image to be backed up to an external hard disk and it was auto detected and mount at /media/disk :

    dd if=/dev/sda of=/media/disk/disk-image.img

    EDIT: to save on disk space--

    dd if=/dev/sda bs=64k conv=noerror,sync | gzip -c -9 | dd of=/media/disk/disk-image.img.gz

  • bingrenling
    RE: Linux Debian relationship to Linux Mint
    The vast majority of Linux distributions are based off of another distribution. The three largest groups are Debian, Red Hat, and Slackware. Ubuntu is Debian based, Linux Mint is based upon Ubuntu which is based upon Debian. Linux Mint also has one ISO that is based directly off of Debian. The differences are going to be the default package set and the default configurations.
    Link to this post 19 May

    The vast majority of Linux distributions are based off of another distribution. The three largest groups are Debian, Red Hat, and Slackware.

    Ubuntu is Debian based, Linux Mint is based upon Ubuntu which is based upon Debian. Linux Mint also has one ISO that is based directly off of Debian.

    The differences are going to be the default package set and the default configurations.

  • bingrenling
    RE: Raspberry PI
    The absolute lightest and fastest is SliTaz. Arch is also a great choice.
    Link to this post 19 May

    The absolute lightest and fastest is SliTaz.

    Arch is also a great choice.

  • bingrenling
    RE: Thoughts on partitioning with Linux for the first time..?
    That seems like a fine plan. I would just remind you that Windows will create two partitions on a default install. This means you cannot have a normal swap partition due to the 4 partition per disk limit. You can still create one post install: dd if=/dev/zero of=/swapfile.img bs=1M count=2048; mkswap /swapfile.img; swapon /swapfile.img Then, add it to your /etc/fstab If you get a second HDD, however, there are some other considerations. Often, it is a good idea to separate your OS and home folder. Many people also like to separate /var A typical scheme may look something like: / - 15GB /var - 15GB /home - 100GB swap - 2GB On a web server, you might see something more akin to: / - 15GB /var - 15GB /var/http - 100GB swap - 2GB
    Link to this post 16 May

    That seems like a fine plan. I would just remind you that Windows will create two partitions on a default install. This means you cannot have a normal swap partition due to the 4 partition per disk limit.

    You can still create one post install:

    dd if=/dev/zero of=/swapfile.img bs=1M count=2048;
    mkswap /swapfile.img;
    swapon /swapfile.img

    Then, add it to your /etc/fstab

    If you get a second HDD, however, there are some other considerations.

    Often, it is a good idea to separate your OS and home folder.

    Many people also like to separate /var

    A typical scheme may look something like:

    / - 15GB
    /var - 15GB
    /home - 100GB
    swap - 2GB

    On a web server, you might see something more akin to:

    / - 15GB
    /var - 15GB
    /var/http - 100GB
    swap - 2GB

  • bingrenling
    RE: traffic redirection by domain name to external addresses
    For port redirection: iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8443 From one IP to another and one port to another: iptables -t nat -I PREROUTING --src 1.1.1.1 --dst 2.2.2.2 -p tcp --dport 80 -j REDIRECT --to-ports 8080 For the redirection of requests from host1 to host2 or host3 (assuming you are loadbalancing), I would probably actually use ldirector and not iptables. If you are also controlling your own DNS, you might use round-robin DNS to do this.
    Link to this post 12 May

    For port redirection:

    iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080

    iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8443

    From one IP to another and one port to another:

    iptables -t nat -I PREROUTING --src 1.1.1.1 --dst 2.2.2.2 -p tcp --dport 80 -j REDIRECT --to-ports 8080

    For the redirection of requests from host1 to host2 or host3 (assuming you are loadbalancing), I would probably actually use ldirector and not iptables.

    If you are also controlling your own DNS, you might use round-robin DNS to do this.

  • bingrenling
    RE: Starting to learn programming
    If you were looking for simply an editor and not an IDE, you may want to try SciTE, Scribes, or Vim. http://www.scintilla.org/SciTE.html http://scribes.sourceforge.net Good luck with your learning.
    Link to this post 12 May

    If you were looking for simply an editor and not an IDE, you may want to try SciTE, Scribes, or Vim.

    http://www.scintilla.org/SciTE.html

    http://scribes.sourceforge.net

    Good luck with your learning.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board