USA Linux Users Group Forum Index
Log in Register FAQ Memberlist Search USA Linux Users Group Forum Index Album

A question about DD?

 
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » OTHER
View previous topic :: View next topic  
Author Message
mmmna
. . . .


Joined: 21 Apr 2024
Posts: 7224

PostPosted: Wed Jun 24, 2024 1:56 am    Post subject: A question about DD? Reply with quote

To write an Ubuntu Netbook Remix 9.04 image to a flash device, I was told to use dd if=/path/to/downloaded.img of=/dev/device/node bs=1M

I pointed it to my 8Gig SDHC card and I now have 987 megs total capacity on it..... I lost 7.0+ gigs! I'm not worried, I've recovered the total capacity after I installed UNR the last time, but I'd really like to keep the whole capacity so I can use the remaining 7 gigs for a /home directory (this was offered by the UNR 9.04 installer to do this). When I use dd, should I use the 'notrunc' option? Or, how else can I write the 987 meg image and not reduce the capacity of the 8G card?


Back to top
View user's profile Send private message
platinummonkey
Advanced Member


Joined: 01 Mar 2024
Posts: 732
Location: Texas

PostPosted: Wed Jun 24, 2024 2:23 am    Post subject: Reply with quote

one option:
Code:
find / -xdev -print | xargs -0 cp -p -t /mnt/sdcard
# this will first find all files on the / parition (if /home is on a separate parition you'll have to do the below as well and for every other partition as well. Then this will copy them into the target directory with preserved permissions.

#to copy home
find /home -xdev -print | xargs -0 cp -p -t /mnt/sdcard/home


you see, dd, copies bit by bit, and will overwrite the partitioning tables for your sd card hence the "missing" 7gigs. The fact is not gone gone, its just not partitioned and ready to allocate data. if you really want to use dd, expand the img to the exact size of the sd card. yup, all that unused space. not efficient and i urge against it :/



_________________
desktop - FreeBSD 7.2
laptop & server - Archlinux i686 kernel26 2.6.32.10-1
- TAMULinux-2.0.2-ALPHA
USB Boot - Archlinux i686 kernel26 2.6.32.10-1 USB boot
Back to top
View user's profile Send private message Visit poster's website AIM Address
platinummonkey
Advanced Member


Joined: 01 Mar 2024
Posts: 732
Location: Texas

PostPosted: Wed Jun 24, 2024 2:24 am    Post subject: Reply with quote

its also important to note that dd will overwrite anything and everything in its path Wink Razz



_________________
desktop - FreeBSD 7.2
laptop & server - Archlinux i686 kernel26 2.6.32.10-1
- TAMULinux-2.0.2-ALPHA
USB Boot - Archlinux i686 kernel26 2.6.32.10-1 USB boot
Back to top
View user's profile Send private message Visit poster's website AIM Address
mmmna
. . . .


Joined: 21 Apr 2024
Posts: 7224

PostPosted: Wed Jun 24, 2024 2:58 am    Post subject: Reply with quote

Actually.... you might have hit the nail on the head, pm. If the remaining 7 Gig are now considered to be unallocated space, I could just cfdisk it and make a /home partition in the remaining space, yes?



_________________
-Kubuntu 10.04 LTS Beta2 on Celeron D desktop
-PCLinuxOS 2024 LXDE on EeePC 900A with Atom n270 (modded with 32G SATA drive and 2G ram).
Back to top
View user's profile Send private message
platinummonkey
Advanced Member


Joined: 01 Mar 2024
Posts: 732
Location: Texas

PostPosted: Wed Jun 24, 2024 3:07 am    Post subject: Reply with quote

yes, you could do that Razz



_________________
desktop - FreeBSD 7.2
laptop & server - Archlinux i686 kernel26 2.6.32.10-1
- TAMULinux-2.0.2-ALPHA
USB Boot - Archlinux i686 kernel26 2.6.32.10-1 USB boot
Back to top
View user's profile Send private message Visit poster's website AIM Address
mmmna
. . . .


Joined: 21 Apr 2024
Posts: 7224

PostPosted: Wed Jun 24, 2024 5:03 am    Post subject: Reply with quote

I just ran 'cfdisk -z /dev/sdb1' and made 2 primary partitions, then formatted them using 'parted' and 'mkfs'. Even though parted and cfdisk see the partitions and all that, I've rebooted and whenever I pop in the card, Filemanager reports as a single 8g device. In the words of Foghorn Leghorn: "Now I gotta outfox the fox".



_________________
-Kubuntu 10.04 LTS Beta2 on Celeron D desktop
-PCLinuxOS 2024 LXDE on EeePC 900A with Atom n270 (modded with 32G SATA drive and 2G ram).
Back to top
View user's profile Send private message
platinummonkey
Advanced Member


Joined: 01 Mar 2024
Posts: 732
Location: Texas

PostPosted: Wed Jun 24, 2024 9:03 pm    Post subject: Reply with quote

mmmna wrote:
I just ran 'cfdisk -z /dev/sdb1' and made 2 primary partitions..

i hope you mean /dev/sdb

otherwise you just paritioned the first partition Razz

partition with cfdisk. and put a create a filesystem with mkfs. the only two steps required. Then of course image the small / partition with dd or a simple cp



_________________
desktop - FreeBSD 7.2
laptop & server - Archlinux i686 kernel26 2.6.32.10-1
- TAMULinux-2.0.2-ALPHA
USB Boot - Archlinux i686 kernel26 2.6.32.10-1 USB boot
Back to top
View user's profile Send private message Visit poster's website AIM Address
mmmna
. . . .


Joined: 21 Apr 2024
Posts: 7224

PostPosted: Wed Jul 15, 2024 10:43 pm    Post subject: Reply with quote

Well, I meant /dev/sdb1.

/etc/fstab, /etc/mtab both show the complete device (when automagically mounted) as /dev/sdb1; when I unmounted /dev/sdb1, I then tried partitioning /dev/sdb; both cfdisk and fdisk refused to work if I specify /dev/sdb, cfdisk and fdisk work fine with/dev/sdb1 and cfdisk shows the whole capacity that the card is advertised as having.

Did I miss something? I thought it was possible to name whole devices with numerical values: /bus0/lun1/part0 or some such.

Possibly the /dev/sdb part reports the card reader via the USB bus node, but there are 5 holes in the reader and some holes accept multiple card types, and one hole is shared to another hole and if there was a more complicated way to do this, Microsoft must have patented it.



_________________
-Kubuntu 10.04 LTS Beta2 on Celeron D desktop
-PCLinuxOS 2024 LXDE on EeePC 900A with Atom n270 (modded with 32G SATA drive and 2G ram).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » OTHER All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All content © 2024-2009 - Usa Linux Users Group
This forum is powered by phpBB. © 2024-2009 phpBB Group
Theme created by phpBBStyles.com and modified by Crouse