拷贝&拓展ubuntu系统

Posted by laosuan on April 8, 2022

拷贝硬盘

windows下使用


#linux下使用dd命令,我的根目录所在的分区是/dev/sdb5,新硬盘划分的是/dev/sda1。
dd if=/dev/sdb5 of=/dev/sda1
#由于dd命令没有展示中间过程,因此使用另一条命令来让他输出中间过程:
watch -n 5 killall -USR1 dd

拓展硬盘分区

sudo apt-get install gpart
打开gpart图形界面,选中要拓展的分区,右键选择调整大小

修复引导

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt update
sudo apt install -y boot-repair && boot-repair

制作U盘安装系统

UltraISO

Create and restore backup by using the Timeshift’s command line

  1. Create a first backup simply by executing the below command:

    $ sudo timeshift --create
    First run mode (config file not found)
    Selected default snapshot type: RSYNC
    Mounted /dev/sda2 at /media/root/359151f5-efb9-483d-a738-894d57e2d8c8.
    Selected default snapshot device: /dev/sda2
    ------------------------------------------------------------------------------
    Estimating system size...
    Creating new snapshot...(RSYNC)
    Saving to device: /dev/sda2, mounted at path: /media/root/359151f5-efb9-483d-a738-894d57e2d8c8
    Synching files with rsync...
    Created control file: /media/root/359151f5-efb9-483d-a738-894d57e2d8c8/timeshift/snapshots/2020-02-19_18-32-36/info.json
    RSYNC Snapshot saved successfully (39s)
    Tagged snapshot '2020-02-19_18-32-36': ondemand
    

    The above command will also create a new configuration file located at the following location: /etc/timeshift.json.



  2. List all your currently created system backup screenshots:

    $ sudo timeshift --list
    Device : /dev/sda2
    UUID   : 359151f5-efb9-483d-a738-894d57e2d8c8
    Path   : /media/root/359151f5-efb9-483d-a738-894d57e2d8c8
    Mode   : RSYNC
    Device is OK
    1 snapshots, 197.7 GB free
       
    Num     Name                 Tags  Description  
    ------------------------------------------------------------------------------
    0    >  2020-02-19_18-32-36  O 
    
  3. Restore from the backup snapshot:

    $ sudo timeshift --restore --snapshot "2020-02-19_18-32-36"
    
  4. Delete selected backup snapshot:

    $ sudo timeshift --delete  --snapshot '2014-10-12_16-29-08'