Sponsored Content
Top Forums UNIX for Advanced & Expert Users Shrink my partition to new disk Post 302461296 by Corona688 on Sunday 10th of October 2010 01:30:45 AM
Old 10-10-2010
Quote:
Originally Posted by amol28kulkarni
Thanks for the reply
Would it be efficient to copy entire data, is there any way to just copy over the blocks and adjust them according to the newly created filesystem ?
If I knew of any I'd have told you so the first time you asked.
Quote:
Would tar be able to handle the corrupted data like dd can handle since dd does a blind copy.
You can't safely shrink a disk that might be failing -- disk metadata might be corrupted, not just files, making any rearrangement very hazardous to data integrity. You might get a useless hash, or nothing at all. Either make a blind copy, or don't.

There are ways to shrink a blind copy -- compression, or a sparse file -- but none of them leave the resulting image bootable. There's no such thing as a sparse partition, after all, just sparse files. If you're content with having your backup not be bootable, this would work, I wrote sparsecat to help do this. It creates sparse files with a brute-force approach, making sections full of NULLs sparse, meaning it won't screw up because of a trashed sector but might not make everything that COULD be sparse actually sparse. (I don't guarantee its safety or applicability or portability however, it's just a hack I wrote for my own use.)
Code:
dd if=/dev/disk conv=noerror,sync | sparsecat > /mnt/backupdir/sparse.img

Quote:
Is there a way of like creating another sparse image file of 2TB ... then copying over only required data blocks there which will exclude the empty blocks and then resizing the sparse image to 200GB.
If the disk is failing, you can't reliably know which blocks are occupied.

Last edited by Corona688; 10-10-2010 at 02:38 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Disk Partition

Hi All, While my LINUX SERVER installed we didnt' used all the space for partitions. with what tool I can create a new partition or mount point to use the free space. I tried the command fdisk and diskdruid. They are not working. Thanks in advance With Best regards, Varma. (2 Replies)
Discussion started by: jarkvarma
2 Replies

2. Solaris

New disk - how to partition?

Have a solaris x86 running solaris 9. Root disk - logical - mirrored. I added 2 more disks today - and I have mirrored them using array configuration utility. I did a reconfiguration boot - and now I can see the logical disk using format: I then partitioned this the way I wanted (I hope)... (4 Replies)
Discussion started by: frustrated1
4 Replies

3. Solaris

Disk Partition

I have 3 disks to partition in following file system. c1t1d0 = 72gb /prod1 /prod2 /prod3 /prod4 /prod5 I am first time using "format" command to do this. How can i name with specified size. -Adeel (1 Reply)
Discussion started by: deal732
1 Replies

4. UNIX for Advanced & Expert Users

partition disk issue

hi guys, I've got a strange issue, may be one of you has experienced this. SunOS 5.10 Generic_118833-33 sun4u sparc SUNW,Sun-Fire-V440 everything is mirrored. My issue is that I have a umpty directory but seems to have data on. Let me show you # df -h /data Filesystem size used... (10 Replies)
Discussion started by: moustik
10 Replies

5. Filesystems, Disks and Memory

Partition disk

Hi, Can I partition disk in use or would I damage the file store on it? Regards Mehrdad (1 Reply)
Discussion started by: mehrdad68
1 Replies

6. Red Hat

Disk Partition : Skip 1 MB

I want to skip the first cylinder (first 1 MB infact) while I partition my disk using fdisk as it is required that the disk partition to be used (for Oracle RAC Installation) must skip the first 1Mb to avoid overwriting the disk VTOC. The way I am using is: Command (m for help): n Command... (2 Replies)
Discussion started by: jpsingh
2 Replies

7. Solaris

Disk partition slice0

Hi Guys, when performing a disk partition, can any file system other than root be giving to slice 0 or must slice0 hold only root? I am confused about this. Any clarification will be greatly appreciated. Thanks Guys (4 Replies)
Discussion started by: cjashu
4 Replies

8. Red Hat

How to partition your disk?

Hello, I am a new member of the forum. I need an idea on how to partition the disk. My situation is as follows: I have two 3TB disks ognuno.In 6TB total then, but I have to do to force a RAID 1 so my space will be 3TB. I'll have to force install RedHat 5.8 and liquids is to be taken in... (4 Replies)
Discussion started by: Joaquin
4 Replies

9. Red Hat

Shrink LVM partition & create new Linux Primary partition

Hello All, I have a Red Hat Linux 5.9 Server installed with one hard disk & 2 Partitions created on it as follows, /boot - Linux Partition & another is LVM - One VG & under that 5-6 Logical volumes(var,opt,home etc). Here my requirement is to take out 1GB of space from LVM ( Any logical... (5 Replies)
Discussion started by: gr8_usk
5 Replies

10. UNIX for Beginners Questions & Answers

Safe way to shrink lvm vg_*-lv_swap partition and reclaim freed space on Linux?

Hello, # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sr0 11:0 1 1024M 0 rom sda 8:0 0 38.2G 0 disk ├─sda1 8:1 0 500M 0 part /boot └─sda2 8:2 ... (2 Replies)
Discussion started by: centosadmin
2 Replies
scrounge-ntfs(8)					    BSD System Manager's Manual 					  scrounge-ntfs(8)

NAME
scrounge-ntfs -- helps retrieve data from corrupted NTFS partitions SYNOPSIS
scrounge-ntfs -l disk scrounge-ntfs -s disk scrounge-ntfs [-m mftoffset] [-c clustersize] [-o outdir] disk start end DESCRIPTION
scrounge-ntfs is a utility that can rescue data from corrupted NTFS partitions. It writes the files retrieved to another working file system. Certain information about the partition needs to be known in advance. The -l mode is meant to be run in advance of the data corruption, with the output stored away in a file. This allows scrounge-ntfs to recover data reliably. See the 'NOTES' section below for recover info when this isn't the case. OPTIONS
The options are as follows: -c The cluster size (in sectors). When not specified a default of 8 is used. -l List partition information for a drive. This will only work when the partition table for the given drive is intact. -m When recovering data this specifies the location of the MFT from the beginning of the partition (in sectors). If not specified then no directory information can be used, that is, all rescued files will be written to the same directory. -o Directory to put rescued files in. If not specified then files will be placed in the current directory. -s Search disk for partition information. (Not implemented yet). disk The raw device used to access the disk which contains the NTFS partition to rescue files from. eg: '/dev/hdc' start The beginning of the NTFS partition (in sectors). end The end of the NTFS partition (in sectors) NOTES
If you plan on using this program sucessfully you should prepare in advance by storing a copy of the partition information. Use the -l option to do this. Eventually searching for disk partition information will be implemented, which will solve this problem. When only one partition exists on a disk or you want to rescue the first partition there are ways to guess at the sector sizes and MFT loca- tion. See the scrounge-ntfs web page for more info: http://memberwebs.com/swalter/software/scrounge/ AUTHOR
Stef Walter <stef@memberwebs.com> scrounge-ntfs June 1, 2019 scrounge-ntfs
All times are GMT -4. The time now is 06:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy