Which system calls to move data on a device with mounted partitions?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Which system calls to move data on a device with mounted partitions?
# 1  
Old 01-27-2013
Which system calls to move data on a device with mounted partitions?

I need to be able to move data around a disk that has mounted partitions. I am not touching the data on the mounted partition, the MBR or any other disk metadata, only the freespace and unmounted partitions. At the moment I am using libparted but it causes data corruption sometimes although there are no reported errors.

I am experimenting now with open() on, for example, /dev/sdc while /dev/sdc2 is mounted. That also sometimes seems to have problems with busy partitions on the disk. No errors are reported.

Any suggestions?

Thank you.
# 2  
Old 01-28-2013
Moving data on unmounted partitions by access to the raw device is a very dicey operation. Reading and writing are pretty much the same in any mode, in the end, so why can't you just use 'cp -rp'?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

How to modify a disk with mounted partitions?

Hi Guys, I was wondering; can a disk with mounted partitions be modified? If yes, how can this be done? Thanks lots (1 Reply)
Discussion started by: cjashu
1 Replies

2. UNIX for Dummies Questions & Answers

lvrename to a mounted device

Hi, I wanted to rename a filesystem but I forgot to unmount it before running lvrename and now it is still visible when doing df -k old name device: /dev/mapper/vg01-MGRSTR3 mounted as /MGRSTR3 new name: /dev/mapper/vg01-mgrusr3 mounted as /mgrusr3 when trying to unmount the old one... (2 Replies)
Discussion started by: galuzan
2 Replies

3. UNIX for Dummies Questions & Answers

How to Export Glance "Global System Calls" data to a file

Hello... I'm trying to setup a cronjob to record system data using glance at certain times of the day. My question is, how would one export the "Global System Calls" information to a file? Below is the command I have been using and it works to export CPU information. glance -f ... (0 Replies)
Discussion started by: fumus
0 Replies

4. OS X (Apple)

Not mounted, no-driver USB device in terminal (how to access?)

hi, i am on a quest to access and even mount if possible a drive on os x. there is no driver for the device, but it lists fine in the system profiler. can i access its location from the terminal? how? here is what i get on the system profiler: Speed: Up to 480 Mb/sec Manufacturer: SAMSUNG ... (3 Replies)
Discussion started by: sontarieh
3 Replies

5. SCO

file system not getting mounted in read write mode after system power failure

After System power get failed File system is not getting mounted in read- write mode (1 Reply)
Discussion started by: gtkpmbpl
1 Replies

6. Programming

Checking if device is mounted..

Hi, I want to check if a device is mounted before performing actual mount. I was able to check that using the below C code. But in C++ it is throwing the following error: " error: invalid conversion from `int' to `const char*' " C program just generated a warning message, but C++ throws... (3 Replies)
Discussion started by: cjjoy
3 Replies

7. IP Networking

Identification of data calls & voice calls

Is there any facility to filter/identify the data calls and voice calls coming throug modem? OR Can we get the data or voice calls information through a script(preferably C Kermit)? (0 Replies)
Discussion started by: pcsaji
0 Replies

8. UNIX for Dummies Questions & Answers

System calls for cp and mv

Which system calls are made for operations cp and mv (2 Replies)
Discussion started by: gaurava99
2 Replies

9. UNIX for Dummies Questions & Answers

System Calls

What does the system call "dup" do? What is the difference between dup and dup2 I have a fair idea of what it does but I am confused when its coming down to the exact details... Please help me!:confused: (2 Replies)
Discussion started by: clickonline1
2 Replies
Login or Register to Ask a Question