Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Thanks you very much, to AwesomeMachine. You've answered many of my doubts.
By the way, about the "conv=notrunc" problem, I asked that question because English is not my mother tongue, and I cannot understand some sentence structures. I really cannot get what exactly is about the "conv=notrunc" when the first time I read this thread. Another example is that in fact I don't quite understand what you answered me about the "encrypted drive" problem and the "overwritting free space" problem". Nevertheless, I understand your first four replies very clearly and in fact they are my most important questions. As for the others, I will leave them.
Once again, thank you very much!
Click here to see the post LQ members have rated as the most helpful post in this thread.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Original Poster
Rep:
conv=notrunc
Quote:
Originally Posted by lawrence_lee_lee
Thanks you very much, to AwesomeMachine. You've answered many of my doubts.
By the way, about the "conv=notrunc" problem, I asked that question because English is not my mother tongue, and I cannot understand some sentence structures. I really cannot get what exactly is about the "conv=notrunc" when the first time I read this thread. Another example is that in fact I don't quite understand what you answered me about the "encrypted drive" problem and the "overwritting free space" problem". Nevertheless, I understand your first four replies very clearly and in fact they are my most important questions. As for the others, I will leave them.
Once again, thank you very much!
The encryption password for an aes loop device is hashed into the file itself. Therefore, the password can never be changeD, nor recovered if lost.
Conv=notrunc means "Do not truncate the output file".
Copying MBR; why bs 446 vs 512. Storing on SDHC vs floppy or USB
Awesome information, but still not in Linux Answers unless I missed it. Found this from a Wiki.. link!
In one spot the instructions to copy MBR; bs is 512 (entire first sector of HD if I am understanding all this), but in same document (also in other original; Applications_GUI_Multimedia/How_To_Do_Eveything_With_DD?) the bs=446. Why ? What is the significance of the 66 difference ?
How do I save my GRUB (from MBR?) to an SDHC card [ of=/media/SDHC/MBR.boot ??) since Asus Gaming series LTs lack a floppy? Then if=/media/SDHC/MBR.boot of=/dev/sda as required to restore it when I screw something up!
Would like to zero out first part of SDA so I can install XP pro & Vista Premium 64 bit to an HD that already has openSuse 11.0 & Kubuntu 8.10 (in beta stages still) installed
In one spot the instructions to copy MBR; bs is 512 (entire first sector of HD if I am understanding all this), but in same document (also in other original; Applications_GUI_Multimedia/How_To_Do_Eveything_With_DD?) the bs=446. Why ? What is the significance of the 66 difference ?
Yes, 512 will copy the whole 1st sector, the MBR. 446 will copy only the boot code, see my MBR link, especially the last line in the table "Structure of a Master Boot Record":
MBR, total size: 446 + 64 + 2 = 512
Which you use depends on whether you want the partition table or just the boot code. If you're saving, that probably doesn't make much difference; but if you're restoring, it could be crucial.
Quote:
Originally Posted by digital8doug
How do I save my GRUB (from MBR?) to an SDHC card [ of=/media/SDHC/MBR.boot ??) since Asus Gaming series LTs lack a floppy? Then if=/media/SDHC/MBR.boot of=/dev/sda as required to restore it when I screw something up!
In the following 2 code samples, I used the variables "N","GRUB", & SAVE_FILE to make actual dd lines shorter, more general & more easily changed, &, I hope, clearer. Since you asked to "save my GRUB", I used "N=446" to save & restore only the GRUB stage 1 boot code, not the partition table, too. Change that to "512" if you like, but be sure that's what you want to do.
Would like to zero out first part of SDA so I can install XP pro & Vista Premium 64 bit to an HD that already has openSuse 11.0 & Kubuntu 8.10 (in beta stages still) installed
Assuming to want to wipe all Linux, not make a quad-boot installation.
<rant>
<severe flames omitted />
</rant>
I think this might be unnecessary, but I would:
Code:
dd if=/dev/zero of=$SDA bs=512 count=1
I believe that will make the disk appear blank to the M$ installer(s).
I've taken non-technical posts of dubious content out of
the dd thread and slapped them into General. I'm afraid
I have better things to do than sieve through 24 pages of
a thread that should have been a Linux answer in the first
place, if people spot more posts in here that should be
gone, please report those individually.
Can this thread be made Sticky either on a Global or Personal basis. It will take some time to read and comprehend. During that time it would be handy if it showed up on the first page.
Can this thread be made Sticky either on a Global or Personal basis. It will take some time to read and comprehend. During that time it would be handy if it showed up on the first page.
This has been requested a couple of times, and while
I appreciate that it's of great interest for some it's not
of great interest for the majority visiting LQ; so no, it
ain't happening. Just subscribe to the thread, and you
should be able to hunt it down easily.
One of my drives contains an extended partition (/dev/sdb4) :
- in it are two logical partitions :
-- one of them (sdb5) being my /home partition
-- the other sdb6 is an NTFS partition
-- the remaining of the sdb4 partition is still unallocated ( 127 gb )
What is the best policy to backup this extended partition with dd , how to save the partition-table(s) , how to avoid backing up the unallocated area or is this space unreachable by default ??
Can dd be used to backup and restore a single logical partition ?
A lot of questions , I know .
Extended partitions still have an esoteric aspect to me.
Thanks for the help .
weetniks on Ubuntu Hardy Heron
belgium
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Original Poster
Rep:
Since many members, and even some of the mods request this post to be stickied, I'll give my opinion. Sticky posts should be reserved for posts that practically everyone who enters the forum would benefit from reading. The DD post is a good post, but I don't think it is worthy of a sticky.
Because I haven't previously suggested this, I will advise users who wish to have this post in a convenient place, to bookmark it. The URL for the post doesn't change, that I'm aware of. If this is impossible for some reason, members searching for this post may use the advanced search function, search for posts with the word, 'Learn', in the title, search only titles, and only posts made by AwesomeMachine.
This narrows the number to only a few. It isn't difficult to find this one, and you just click on the link, and it brings you right here.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Original Poster
Rep:
Quote:
Originally Posted by weetniks
One of my drives contains an extended partition (/dev/sdb4)
-- in it are two logical partitions :
-- one of them (sdb5) being my /home partition
-- the other sdb6 is an NTFS partition
-- the remaining of the sdb4 partition is still unallocated ( 127 gb )
What is the best policy to backup this extended partition with dd , how to save the partition-table(s) , how to avoid backing up the unallocated area or is this space unreachable by default ??
Can dd be used to backup and restore a single logical partition ?
A lot of questions , I know.
PC hard drives are limited to 4 primary partitions. There are only enough bytes for 4 partitions in the Master Boot Record, or sector 1 of the HDD. But, the drive only needs 1 primary partition, and the other 3 partitions can be made logical.
Within a logical partition entry, is a pointer to where the logical partition is located on the drive. Within this location is logical partition table, that describes the logical drives within the logical (or extended), partition.
There is a limit to how many logical drives there can be in a logical partition, but it isn't a realistic limitation.
When one uses dd, he makes verbatim copies of filesystems. I don't think it would work to use dd on a logical partition, and have it duplicate all the logical file systems. You would want to use the logical drive devices, specified to dd.
Device Boot Start End Blocks Id System
/dev/sdb1 1 13 104391 83 Linux
/dev/sdb2 * 14 2180 17406427+ 83 Linux
/dev/sdb3 2181 8554 51199155 83 Linux
/dev/sdb4 8555 14495 47721082+ 5 Extended
/dev/sdb5 8555 14176 45158683+ 83 Linux
/dev/sdb6 14177 14495 2562336 83 Linux
You would not use /dev/sda4, but rather /dev/sda5 and /dev/sda6, within /dev/sda4. Because the unallocated space is not part of a file system, it will not be duplicated, unless you specify /dev/sda4, in the above example.
> How to make a bootable CD from a bootable floppy
> Put the floppy in the floppy drive, and don't mount it.
> dd if=/dev/fd0 of=/home/sam/floppy.img
Hey AwesomeMachine, I found your article incredibly useful! Didn't quite follow why we need to unmount the floppy drive above. Would you reply back, or alternatively, include inline a few words on the whys of it? Many thanks!
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Original Poster
Rep:
Need to unmount floppy image ...
Quote:
Originally Posted by somedeveloper
> How to make a bootable CD from a bootable floppy
> Put the floppy in the floppy drive, and don't mount it.
> dd if=/dev/fd0 of=/home/sam/floppy.img
Hey AwesomeMachine, I found your article incredibly useful! Didn't quite follow why we need to unmount the floppy drive above. Would you reply back, or alternatively, include inline a few words on the whys of it? Many thanks!
I made a slight adjustment to the OP. There are several reasons. The best one is that files mounted as loop devices are not simultaneously available as files.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.