Basic Tutorial On How To Properly Clone Drives On Linux With DD

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay so today i'll be going over with y'all on how to do a basic hard drive clone using the dd command line so in order to do that we're going to need a few things three of them being your source hard drive your destination hard drive and a live bootable usb of the linux distribution of your choice so for me i'm going to be using again two base live usb and i'm going to be cloning a debian installation to a blank hard drive this one says ubuntu on it but just disregard it because it's not there anymore okay so now what i'm be doing is i'm going to go ahead and be inserting the source drive the destination drive and again to net install usb which is also a live usb so let's go ahead and open up the rack here okay so now i'm going to go ahead and insert my source drive which has debian on it my destination drive and my gen 2 net install usb which is the same thing as a generic linux live usb just because you're booting up to a terminal right away that has access to certain applications etc etc it's just not a live usb when it comes to having a full desktop environment and so forth okay let's go ahead and power on the developer server here and i'm going to go ahead and switch to the idrac go ahead and launch the console here go ahead and get into my bios boot manager let's go ahead and go to the bios boot menu it's interesting on the latest bios of the r720xd you press f11 to get into the bios boot manager but it really takes you a page back and then you have to click the bios boot manager okay let's go ahead and move to the flash drive now if you get this prompt usually you won't get this prompt but if you do get it you just type in gentoo and hit enter okay so we're now inside the gentoo installation usb let's go ahead and clear this screen out so y'all can see so the first thing we're going to want to do here is get the dev name for the source drive and the dev name for the destination drive so do that i'm going to go ahead and type in fdisk dash dash list press enter here a few times so you guys can see okay so if you look here dev sda is the source drive so as you can see it says partition 2 does not start on a physical sector boundary that's that's just from the default debian installation all files on one partition we're going to go ahead and start the dd clone process so if you're just cloning to a drive that's the exact same size or bigger you don't have to worry about doing an fsck you don't have to worry about moving the partitions and resize them and making sure they're in order etc etc you can just move on to dd so in order to go ahead and do the cloning process i'm going to go ahead and type in dd if equals dev sda space off for output file equals dev sdc and i'm going to do bs equals for block size 64k now a lot of people don't understand what the block size is now this is talking about the block size of dd so the chunks of data it's going to be sentiments can be sent to them in 64 chunks and then there's the block size on the hard drive which is how the hard drive is formatted from the factory and the block size they set for that drive and there are some utilities where you can change it but i'd recommend leaving it at the default box size so generally the smaller the block size when it comes to striping or dde or anything else you're doing the smaller the block size the more efficiently it works with smaller files the larger the block size the more efficient it works with the larger files so generally i think a good industry standard is 64k maybe in 32k then you're going to want to go ahead and type in status equals progress it's just going to give you the progress of the actual process and i'm just going to go ahead hit enter here another important note also with the larger block size on dd the transfer rate goes faster so you're generally not going to want to use the default block size on dd because it's only 512 bytes and it makes the transfer process really slow and plus that's like way too small so i always use a little bit bigger block size i honestly don't know why it's that small i think because dd was made so long ago but then again i don't know so i personally think when you're cloning to a larger driver drive that's the same size this is hands down the best way to climb the hard disk it's the simplest it's one command line bam you're done you can see there in the server they're blinking away so take this transfer rate with a grain of salt if you're not using like an offline google sync command then the transfer rate isn't going to be literal so whenever the command finishes you're going to want to check the activity lights and make sure they're no longer blinking to confirm the process is actually complete and the reason i say that is because a lot of times the device has to catch up the kernel but the drive is still writing to the other drive and you have to wait for it to catch up now you can type in off lag equals sync and then when it's done it's actually done and it's going to show you the the read write transfer speeds in pretty much real time but i like to do this way just because this is generally the one of the faster methods to use dd so sometimes the activity like just going to blink a little more whenever the dd finishes but it's not actually finished so you're going to want to make sure you check the activity light just to confirm if you don't have activity lights then after the status equals progress you're going to type in off lag equals sync that way when dd is finished you actually know it's finished but when you use that command it does slow the transfer rate down quite a bit sometimes takes quite a bit longer okay let me push enter here a few times so my banner is on the way okay so if you look here the clone process has finished now because we cloned to a drive that was the exact same size we're gonna have to worry about moving the partition shrinking the partition doing the fsck on the partition and all that other stuff i have another tutorial i'm about to post too that will it's a more in-depth tutorial on using dd and how to do a full drive clone with dd to a smaller drive and move the partitions resize them and scan them for file system errors the correct way so now let's go ahead and reboot here just to confirm that clone is working which there's no reason it won't work so it's going to work bad memory in the server the command completed so there's no reason it shouldn't work so i'm gonna go ahead and just type in reboot here and i'm gonna go ahead and yank out the source drive and my gentoo installation usb as and as you can see the bootloader just popped up and started posting to the os and that's it we're at the login screen i hope this video helped all out give you a better understanding of dd and the block size or the byte size command line switch that dd uses and uh if you like the information and how i break it down and when i'm doing everything uh make sure you like and subscribe to the channel click the bell icon and maybe give me a thumbs up or share some links let's grow the channel you
Info
Channel: FIX A PC
Views: 6,223
Rating: undefined out of 5
Keywords:
Id: ARk0vl8gbHA
Channel Id: undefined
Length: 9min 54sec (594 seconds)
Published: Thu Sep 23 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.